cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

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

Hrishabh.Sharma
13-Aquamarine

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

HrishabhSharma_0-1738585039952.png

 

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3

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.

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

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

Announcements


Top Tags