Replace now() which is deprecated (processone/ejabberd#1264)
This commit is contained in:
parent
41371cf7fe
commit
65f4267fc1
|
@ -62,8 +62,7 @@ time_to_ms(IntervalUnit, IntervalNum) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
time_until_event(IntervalMS) ->
|
time_until_event(IntervalMS) ->
|
||||||
{MegaSecs, Secs, MicroSecs} = erlang:now(),
|
NowMS = p1_time_compat:system_time(micro_seconds),
|
||||||
NowMS = (MegaSecs*1000000 + Secs)*1000 + round(MicroSecs/1000),
|
|
||||||
MSSinceLastEvent = (NowMS rem IntervalMS),
|
MSSinceLastEvent = (NowMS rem IntervalMS),
|
||||||
(IntervalMS - MSSinceLastEvent).
|
(IntervalMS - MSSinceLastEvent).
|
||||||
|
|
||||||
|
|
|
@ -260,8 +260,8 @@ get_gregorian_day() -> calendar:date_to_gregorian_days(date()).
|
||||||
|
|
||||||
get_now_iso(Timezone) ->
|
get_now_iso(Timezone) ->
|
||||||
TimeStamp = case Timezone of
|
TimeStamp = case Timezone of
|
||||||
local -> calendar:now_to_local_time(now());
|
local -> calendar:local_time();
|
||||||
universal -> calendar:now_to_universal_time(now())
|
universal -> calendar:universal_time()
|
||||||
end,
|
end,
|
||||||
binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).
|
binary_to_list(jlib:timestamp_to_legacy(TimeStamp)).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue