Re: How can I get UNIX in milliseconds format?
William Welliver <[email protected]> Thu, 25 Apr 2019 13:53:08 -0400 (EDT)
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
Further to bertrand's suggestion, there's a text file with a lot of useful
info in the source code directory of the Calendar module:
http://pike-librarian.lysator.liu.se/colorize.xml?module=pike.git&file=lib/modules/Calendar.pmod/FAQ
Bill
On Thu, 25 Apr 2019, Bertrand LUPART - Linkeo.com wrote:
> 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
>
>