diff --git a/mod_cron/src/mod_cron.erl b/mod_cron/src/mod_cron.erl index 32926ab..1d15d44 100644 --- a/mod_cron/src/mod_cron.erl +++ b/mod_cron/src/mod_cron.erl @@ -62,8 +62,7 @@ time_to_ms(IntervalUnit, IntervalNum) -> end. time_until_event(IntervalMS) -> - {MegaSecs, Secs, MicroSecs} = erlang:now(), - NowMS = (MegaSecs*1000000 + Secs)*1000 + round(MicroSecs/1000), + NowMS = p1_time_compat:system_time(micro_seconds), MSSinceLastEvent = (NowMS rem IntervalMS), (IntervalMS - MSSinceLastEvent). diff --git a/mod_logxml/src/mod_logxml.erl b/mod_logxml/src/mod_logxml.erl index 37c7d66..9ab5ece 100644 --- a/mod_logxml/src/mod_logxml.erl +++ b/mod_logxml/src/mod_logxml.erl @@ -260,8 +260,8 @@ get_gregorian_day() -> calendar:date_to_gregorian_days(date()). get_now_iso(Timezone) -> TimeStamp = case Timezone of - local -> calendar:now_to_local_time(now()); - universal -> calendar:now_to_universal_time(now()) + local -> calendar:local_time(); + universal -> calendar:universal_time() end, binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).