Re: How can I get UNIX in milliseconds format?

"Bertrand LUPART - Linkeo.com" <[email protected]> Thu, 25 Apr 2019 18:18:54 +0200
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Hey Amit,


> Thank you for the replay, Bertrand, but what if I want to not hardcode the time and use a time I’m getting from a certain API? Something which looks like:
> ` 2019-04-25T15:10:03.193000+00:00`
> To be converted to ms using the Epoch?

You'd want something like this:

> object s = Calendar.parse("%Y-%M-%aT%h:%m:%s.%f","2019-04-25T15:10:03.193000+00:00");
> s->f_unix_time();
(1) Result: 1556197803.193


You'll get a nice overview of the Calendar module here:

http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Calendar.html

-- 
Bertrand LUPART
smime.p7s (application/pkcs7-signature, 3.8 KB) - not displayed