Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Change date format in an easier way in objectscript

Question
ED Coder · Nov 24, 2020

Change date format in an easier way in objectscript

I am getting the date 20201121090000 in the HL7 message, How do I convert it to 2020-11-21 09:00:00 in a easy way?

I am currently doing it by extracting the first 7 values and splitting as date and time and then adding a hyphen using substring.

Is there an easier way by using $ZDATE? or something like that?

#ObjectScript #Ensemble

Source URL:https://community.intersystems.com/post/change-date-format-easier-way-objectscript