SysTime object from unixtime

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 12 18:40:03 PDT 2015


The "interfacing to C" header of this page talks about it:

http://dlang.org/intro-to-datetime.html

import std.datetime;
import core.stdc.time;
void main() {
         time_t unixTime = core.stdc.time.time(null);
         auto stdTime = unixTimeToStdTime(unixTime);
         auto st = SysTime(stdTime);
}


I wish std.datetime made this a bit easier but that's how to do 
it.


More information about the Digitalmars-d-learn mailing list