Question
Tom Bruce · Mar 30

How do I return YYYYMMDDHHMM

Hi, I’m using $ZDATETIME to return the following

  • USER>w $ZDATETIME($zdth($zstrip("2022-03-29T15:10:00+0100","<>W"), 3,5),3)
  • Output: 2022-03-29 15:10:00

I would like to return just the YYYYMMDDHHMM i.e. stripping out the seconds.

 Does $ZDATETIME have an option for this?

Product version: IRIS 2022.1
0
0 149
Discussion (4)1
Log in or sign up to continue

Hi,

You can use 8 for the date format part, but there is no time format parameter for HHMM.
Try with this line :

w $tr($ZDATETIME($zdth($zstrip("2022-03-29T15:10:00+0100","<>W"), 3,5),8,2)," :","")

Hi,

Try below command, this will give you the output in YYYYMMDDHHMM  format.  

w $extract($tr($zstrip("2022-03-29T15:10:00+0100","*p"),"TZ", ""),1,12)

Thanks,

Anusri

you may try

USER>write $tr("abcdefghijkl","abcdxefxghxijxkl","2022-03-29T15:10:00+0100")