Data output of code block is reformatting datetime

I am formatting a date to output in (2024-03-05 12:50:12) format. When I log out the variable it is clear that my syntax is correct and moment.js is in fact formatting as expected.

The issue is that in the Data output it is reformatting to Oct 24, 2022 12:00 AM format.

So I am assuming the retool is reformatting based on some default. The problem is that it is not clear if the output has been reformatted or if that just the way it is being rendered. Additionally until I realized what was going on I spent 20 trying to figure out why my .format('YYYY-MM-DD HH:mm:ss') wasn't working. And I hate going to the moment.js docs :slight_smile:


Could you post what's being returned from the block? Using moment(price[0]).format(...) should return a string, so there shouldn't be any post-processing of the date string afterwards.

The output seems good, as you can see in the next blocks input. But I am wondering why Retool would render it as Oct 24, 2022 12:00AM. All this does is lead to confusion.

Hi @Sandy_Corsillo, could you share a console log of "price[0]" before doing the formatting with moment.js? We would love to see how the date object looks originally.