Convert from now() to os:timestamp()
This commit is contained in:
parent
868eb1acf6
commit
97ad84deb8
1 changed files with 2 additions and 3 deletions
|
@ -70,7 +70,7 @@ stop() ->
|
||||||
application:stop(qdate).
|
application:stop(qdate).
|
||||||
|
|
||||||
to_string(Format) ->
|
to_string(Format) ->
|
||||||
to_string(Format, now()).
|
to_string(Format, os:timestamp()).
|
||||||
|
|
||||||
to_string(Format, Date) ->
|
to_string(Format, Date) ->
|
||||||
to_string(Format, ?DETERMINE_TZ, Date).
|
to_string(Format, ?DETERMINE_TZ, Date).
|
||||||
|
@ -343,7 +343,7 @@ to_unixtime(ToParse) ->
|
||||||
calendar:datetime_to_gregorian_seconds(Date) - ?UNIXTIME_BASE.
|
calendar:datetime_to_gregorian_seconds(Date) - ?UNIXTIME_BASE.
|
||||||
|
|
||||||
unixtime() ->
|
unixtime() ->
|
||||||
to_unixtime(now()).
|
to_unixtime(os:timestamp()).
|
||||||
|
|
||||||
to_now(Now = {_,_,_}) ->
|
to_now(Now = {_,_,_}) ->
|
||||||
Now;
|
Now;
|
||||||
|
@ -371,7 +371,6 @@ deregister_format(Key) ->
|
||||||
qdate_srv:deregister_format(Key).
|
qdate_srv:deregister_format(Key).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
unixtime_to_now(T) when is_integer(T) ->
|
unixtime_to_now(T) when is_integer(T) ->
|
||||||
MegaSec = floor(T/1000000),
|
MegaSec = floor(T/1000000),
|
||||||
Secs = T - MegaSec*1000000,
|
Secs = T - MegaSec*1000000,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue