Question Krishnaveni Kapu · Jun 3, 2024

datetime in format - yyyymmddhhmmss

I receive dateTime in this format - yyyy-mm-ddThh:mm:ss+01:00

for ex : 2024-05-31T17:33:08+01:00
I wanted it to convert to yyyymmddhhmmss

desired output = 20240531173308

Comments

Chris Stewart · Jun 3, 2024

If you just want a very basic conversion (i.e. not converting to a canonical date type first), then this will work

set dt = "2024-05-31T17:33:08+01:00"

set formatteddt=$ZSTRIP($PIECE(dt,"+",1),"*WPA")

write formatteddt

20240531173308
0
Iryna Mykhailova · Jun 3, 2024

Another way

WRITE$ZSTRIP($ZDATETIME($HOROLOG, 8), "*P")
0