Dateconversion
Hi Community,
I need to convert date 1997-08-09 10:38:39.700000000 into this format 1997-08-09T10:38:39Z
I have tried using all date function $ZDH,$ZDT no luck can anyone help me to convert this into required format.
Thanks,
Smythee
Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.1 (Build 312_1_18937U) Fri Apr 26 2019 17:58:36 EDT
$Extract ($E) and $Translate ($TR) can provide a string manipulation
So steps are:
Ignore if already the case, but would also recommend familiarity with $Piece, $Select and "[" (Contains operator) . $Find can also be efficient in string searches.
Yes thank you,
Can we do that by using date function $ZDATE,$ZDATEH,$ZDATETIMEH?
w $ZDT($ZDTH(timeAndDate,3,9),3,7)
Thank you
Can you help me understand Why we used $ZDT($ZDTH(timeAndDate,3,9),3,7) 3,9 and 3,7 while converting
Thanks,
Smythee
for $ZTDH:
https://docs.intersystems.com/iris20231/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_fzdatetimeh
for $ZDT:
https://docs.intersystems.com/iris20231/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_fzdatetime
USER>r x 1997-08-09 10:38:39.700000000 USER>w $ZDTH(x,3,,9) 57199,38319.7 USER>w $zdt($ZDTH(x,3,,9),3,7) 1997-08-09T08:38:39Z USER>w $zdt($ZDTH(x,3,,9),3,7,9) 1997-08-09T08:38:39.700000000Z USER>