erlang:system_info( start_time ) as date_time?
bengt
cean.ebengt@REDACTED
Sat Apr 11 19:09:48 CEST 2020
Thank you.
Time to upgrade Erlang at home (where I was looking in calendar without finding anything).
> On 7 Apr 2020, at 00:02, Rickard Green <rickard@REDACTED> wrote:
>
>
>
> On Mon, Apr 6, 2020 at 10:34 PM bengt <cean.ebengt@REDACTED <mailto:cean.ebengt@REDACTED>> wrote:
> Greetings,
>
> How do I get from
> 1> erlang:system_info(start_time).
> -576460752000000000
>
> to some thing like {{2020,4,6},{22,27,0}} ?
>
>
>
> For example:
> calendar:system_time_to_local_time(erlang:system_info(start_time) + erlang:time_offset(), native).
>
> There is also some other system_time_to_* functions in calendar. Note that if you are using single or multi time warp mode <https://erlang.org/doc/apps/erts/time_correction.html#Time_Warp_Modes <https://erlang.org/doc/apps/erts/time_correction.html#Time_Warp_Modes>> the time offset may have changed since you started the VM. That is, depending on use case you may want to save the time offset when starting the system.
>
> Different question:
> Is it possible to find out when a gen_server was started? Or how long it has been running? Without letting init/1 save it in state.
> It would help me finding out if a gen_server was started by its supervisor about the time when the data transfer suddenly dipped.
>
>
>
> No, you need to save this time yourself if needed.
>
> Best Wishes,
> bengt
>
> Regards,
> Rickard
> --
> Rickard Green, Erlang/OTP, Ericsson AB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200411/9ce3c725/attachment.htm>
More information about the erlang-questions
mailing list