[erlang-questions] Getting system start time in UTC?

Danil Zagoskin z@REDACTED
Mon Oct 23 14:15:34 CEST 2017


Maybe erlang:system_info(start_time) is what are you looking for.

Get Unix time at system start:
erlang:convert_time_unit(erlang:system_info(start_time) +
erlang:time_offset(), native, seconds).

On Mon, Oct 23, 2017 at 2:05 PM, Roger Lipscombe <roger@REDACTED>

> I can get the node's uptime with erlang:statistics(wall_clock), which
> is in milliseconds, and can easily be converted into days, hours, etc.
> representing how long this node has been up.
> Is there an easy way to get the start time of the node, represented as
> a UTC date/time? I'd like to be able to print "Up since dd/MM/yyyy (D
> days ...", etc.
> Obviously, I *could* subtract the uptime from the current date/time,
> but that seems more complicated than necessary, assuming the node has
> (somewhere) the actual start time.
> Thanks,
> Roger.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Danil Zagoskin | z@REDACTED
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171023/5c4704e0/attachment.htm>

More information about the erlang-questions mailing list