odd now() behaviour

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

odd now() behaviour

amitm
Hi,

I am seeing an odd behavior with now() on my laptop running ubuntu 8.04 with
R13A.

I had a running erlang shell when I closed the laptop, and the machine went
into suspend mode. The next day when the laptop came out of suspend mode, on
the
erlang shell,

calendar:local_time().     returned the correct date/time while

calendar:now_to_local_time(now()).    printed out the time which was behind
by the same amount of time as the laptop was suspended.

Is this a bug or the expected behaviour of now()?

Regards,
  Amit
Reply | Threaded
Open this post in threaded view
|

Re: odd now() behaviour

Zoltan Lajos Kis
Hi,

Check the +c emulator flag and its description:
http://erlang.org/doc/man/erl.html#emu_flags

Regards,
Zoltan.

> Hi,
>
> I am seeing an odd behavior with now() on my laptop running ubuntu 8.04
> with
> R13A.
>
> I had a running erlang shell when I closed the laptop, and the machine
> went
> into suspend mode. The next day when the laptop came out of suspend mode,
> on
> the
> erlang shell,
>
> calendar:local_time().     returned the correct date/time while
>
> calendar:now_to_local_time(now()).    printed out the time which was
> behind
> by the same amount of time as the laptop was suspended.
>
> Is this a bug or the expected behaviour of now()?
>
> Regards,
>   Amit
>



________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Reply | Threaded
Open this post in threaded view
|

Re: odd now() behaviour

Kenneth Lundin
In reply to this post by amitm
Yes this is expected behavior.

See the +c option to the erl command for an explanation on how erlang:now works.
http://www.erlang.org/doc/man/erl.html

/Kenneth Erlang/OTP Ericsson

On Tue, Aug 11, 2009 at 7:30 AM, Amit Murthy<[hidden email]> wrote:

> Hi,
>
> I am seeing an odd behavior with now() on my laptop running ubuntu 8.04 with
> R13A.
>
> I had a running erlang shell when I closed the laptop, and the machine went
> into suspend mode. The next day when the laptop came out of suspend mode, on
> the
> erlang shell,
>
> calendar:local_time().     returned the correct date/time while
>
> calendar:now_to_local_time(now()).    printed out the time which was behind
> by the same amount of time as the laptop was suspended.
>
> Is this a bug or the expected behaviour of now()?
>
> Regards,
>  Amit
>

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Reply | Threaded
Open this post in threaded view
|

Re: odd now() behaviour

amitm
In reply to this post by Zoltan Lajos Kis
Thanks.

2009/8/11 Zoltan Lajos Kis <[hidden email]>

> Hi,
>
> Check the +c emulator flag and its description:
> http://erlang.org/doc/man/erl.html#emu_flags
>
> Regards,
> Zoltan.
>
> > Hi,
> >
> > I am seeing an odd behavior with now() on my laptop running ubuntu 8.04
> > with
> > R13A.
> >
> > I had a running erlang shell when I closed the laptop, and the machine
> > went
> > into suspend mode. The next day when the laptop came out of suspend mode,
> > on
> > the
> > erlang shell,
> >
> > calendar:local_time().     returned the correct date/time while
> >
> > calendar:now_to_local_time(now()).    printed out the time which was
> > behind
> > by the same amount of time as the laptop was suspended.
> >
> > Is this a bug or the expected behaviour of now()?
> >
> > Regards,
> >   Amit
> >
>
>
>