Skip to main content
13-Aquamarine
February 3, 2025
Solved

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

  • February 3, 2025
  • 3 replies
  • 1024 views

HrishabhSharma_0-1738585039952.png

 

Best answer by VladimirRosu_116627

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

Rocko
19-Tanzanite
February 3, 2025

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.

19-Tanzanite
February 3, 2025

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");

Community Manager
February 20, 2025

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