Is there a simplier way to get posix time with fractional seconds?
Currently what I have is:
set now = $now()
set ts = $zdt(now,-2) _ "." _ $p(now, ".", 2)
ObjectScriptObjectScript
Docs state (for -2 dformat):
Fractional seconds in the input value are permitted, but ignored.
I wonder if there's some other way to get posix time with fractional seconds?
How about this? :-)
USER>w ##class(%SYS.Python).Import("time").time() 1661966455.799232244
Thanks. That'll work.
Except that calling Python is about 10x slower, although it gives probably the value that you want.
$Now() gives a different value because it doesn't take Daylight Savings Time into account.
Not really, more like faster if you need to call it more than once:
Results in: