Skip to main content
Feb 3, 2025 12:18 PM UTC
Solved

Getting wrong formatted date when we are using dateFormat function since Jan 31 2025

HrishabhSharma_0-1738585039952.png

 

Feb 3, 2025 2:19 PM UTC

What @Rocko commented is correct, DD is day of the year.

To add more detail, I will add an excerpt from my snippet documentation - please check the link:

 

  • dateFormat

Description: returns a datetime as a string, formatted in a specific way

The format used is the one from the joda library, and specific examples can be seen at http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html

Example Usage (we get the current date and we output as a string, formatted in a specific format):

 

// dateValue:DATETIME

var dateValue = new Date();

 

// dateFormat(dateValue:DATETIME, dateFormat:STRING):STRING

var result = dateFormat(dateValue, "yyyy-MM-dd HH:mm:ss");

3 replies

Feb 3, 2025 12:37 PM UTC

DD is probably day of year. have you tried "dd"?

Also, next time please try to provide a proper description of the issue and a question to the audience, instead of just a headline and a screenshot.

It's much more polite and people are more inclined to help you.

Feb 3, 2025 2:19 PM UTC

What @Rocko commented is correct, DD is day of the year.

To add more detail, I will add an excerpt from my snippet documentation - please check the link:

 

  • dateFormat

Description: returns a datetime as a string, formatted in a specific way

The format used is the one from the joda library, and specific examples can be seen at http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html

Example Usage (we get the current date and we output as a string, formatted in a specific format):

 

// dateValue:DATETIME

var dateValue = new Date();

 

// dateFormat(dateValue:DATETIME, dateFormat:STRING):STRING

var result = dateFormat(dateValue, "yyyy-MM-dd HH:mm:ss");

Feb 20, 2025 9:52 PM UTC

Hi @Hrishabh.Sharma 

 

It appears your question has been answered.  If you agree, please mark the appropriate response as the Accepted Solution.

 

If you still have questions, please let us know so we can continue to provide support.

 

Regards.

 

--Sharon