Soufiane Amroun · Sep 25, 2017

Convert a timestamp into its corresponding date

Hi world ,

when i apply this command :

USER>write obj.biometrics.%Get(0).timestamp

i've this timestamps form  : 2017-05-17T13:45:40

but in my program i want to have a standard form " date & time" like (2017-05-17  13:45:40)

Please how can i do? is there any method in the " %Library.TimeStamp" that allow this kind of operations?

thank you for helping.

0 796
Discussion (6)0
Log in or sign up to continue

write $TRANSLATE(obj.biometrics.%Get(0).timestamp,"T"," ")

Soufiane, please mark Robert's answer as "accepted".

Maybe also note that your thanks to Robert might have worked better as a "comment" under his answer, rather than being posted as a new answer on your original question.

Nope! Click on the check right before the "ANSWER" and you'll mark this answer as accepted. Remember that only you, the OP, can do it!

Accepting answers will move the answers counter up!

This way you don't even need to reply with a thanks, as we consider checking an answer and upvoting a post the same as that.

thank you very much Robert , it works very well :)

or more object style

write ##class(%Library.TimeStamp).XSDToLogical(obj.biometrics.%Get(0).timestamp)