How to get current time as long or ulong?

Charles Hixson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 5 11:16:31 PDT 2016


I've been reading std.datetime documentation backwards and forwards, but 
if the information is there, I've been missing it.

How do I get the current time as a long?

Clock.currTime() returns a SysTime, and while currently I can convert 
that to a long, this is because I looked into the code. What's the 
supported way?  All the documentation seems to be based around auto, 
which is great if you don't need to store it in memory with a defined 
number of bits allocated...but lousy if you do.   (E.g., I don't want to 
store a time zone, just the UTC time.

What I'm looking for is the opposite of the "FromUnixTime" function.



More information about the Digitalmars-d-learn mailing list