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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Get actual Time Stamp

MS_FLiX_HSD
7-Bedrock

Get actual Time Stamp

Hey Guys! As we can't import libraries into Thingworx, I have a problem regarding a time stamp. 

For my factory I need to generate the time stamp in the following format: YYYY-MM-DDThh:mm:ss.fffZ in UCT standard time. 

 

When I use: var date = dateFormat(new Date(), "MMMMM d, yyyy hh:mm:ss"); The date returns obviously in the "MMMMM d, yyyy hh:mm:ss" format. I use this format, becasue I can't use "YYYY-MM-DDThh:mm:ss.fffZ" in the dateFormat-function, because then a failure is returned regarding the T and the Z. 

 

I hope anyone can help me to return the actual UCT time in the following format: "YYYY-MM-DDThh:mm:ss.fffZ"

 

1 ACCEPTED SOLUTION
4 REPLIES 4

Thank you! This seems like it's working.

Additional article - "How to change the default timestamp display in ThingWorx": https://www.ptc.com/en/support/article/cs232236 

Thank you for the reply! Unfortunately I have to have the T & Z into the time stamp. 

Top Tags