timestamp in any timezone
- Posted by petelomax Feb 19, 2018
- 1247 views
I need a timestamp in seconds since 1/1/1970 0:0:0 UTC
The problem I'm getting is that it works here, in GMT, but the same code running in Texas is 6 hours (21600 seconds) adrift.
This is the (phix only) code I'm currently using:
include builtins\timedate.e timedate t0 = parse_date_string("1/1/1970 UTC",{"D/M/YYYY tz"}) function timestamp() sequence d = date() string res = sprintf("%d",{timedate_diff(t0,d,DT_SECOND)}) return res end function ?timestamp()
Any suggestions?