Question 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.

Comments

Robert Cemper · Sep 25, 2017

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

0
John Murray  Sep 25, 2017 to Soufiane Amroun

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.

0
Rubens Silva  Sep 25, 2017 to Soufiane Amroun

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.

0
Soufiane Amroun · Sep 25, 2017

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

0
Robert Cemper · Sep 25, 2017

or more object style

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

0