Skip to main content
Nov 17, 2021 9:35 AM UTC
Solved

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"

 

4 replies

Nov 22, 2021 7:46 AM UTC

Thank you! This seems like it's working.

Nov 17, 2021 5:00 PM UTC

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

Nov 22, 2021 7:47 AM UTC

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