Ramyasri Kapalavai · Dec 31, 2020

Convert date and time into CCYYMMDDHHMMSS

How to convert date and time into CCYYMMDDHHMMSS format??

For example the date and time format is 12/10/2019 21:41

1 1 6 108


write $translate($zdt($h,8)," :")

If your input (date and time) format is the same as the example you provided,

set inpDateTime = "12/10/2019 21:41"

then use this one:

write  $tr($zdt($zdth(inpDateTime,1,2),8,1),": ")  --> 20191210214100

and if you want it "a little bit faster", the try this one

write  $tr("abcdefghijkl00","ef/gh/abcd ij:kl",inpDateTime)  --> 20191210214100

and you will get a speed gain of over 33%

Happy New Year!

(But this time, without Covid-19, if possible!)