<div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 6, 2020 at 10:34 PM bengt <<a href="mailto:cean.ebengt@gmail.com">cean.ebengt@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Greetings,<br><br>How do I get from<br><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco"><span style="font-variant-ligatures:no-common-ligatures">1> erlang:system_info(start_time).</span></div><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font style="font-size:10px" face="Monaco">-576460752000000000</font><br><br>to some thing like {{2020,4,6},{22,27,0}} ?<br><br><br></span></div></div></blockquote><div><br>For example:<br>  calendar:system_time_to_local_time(erlang:system_info(start_time) + erlang:time_offset(), native).<br><br></div><div>There is also some other system_time_to_* functions in calendar. Note that if you are using single or multi time warp mode <<a href="https://erlang.org/doc/apps/erts/time_correction.html#Time_Warp_Modes">https://erlang.org/doc/apps/erts/time_correction.html#Time_Warp_Modes</a>> 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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">Different question:<br>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.<br>It would help me finding out if a gen_server was started by its supervisor about the time when the data transfer suddenly dipped.<br><br><br></span></div></div></blockquote><div><br></div><div>No, you need to save this time yourself if needed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">Best Wishes,<br>bengt</span></div></div></blockquote></div><br clear="all"></div><div>Regards,<br></div><div>Rickard<br></div><div dir="ltr">-- <br><div dir="ltr" class="gmail_signature">Rickard Green, Erlang/OTP, Ericsson AB</div></div></div></div>