Initial commit
This commit is contained in:
commit
a6272848f9
379 changed files with 74829 additions and 0 deletions
12
build/dev/javascript/gleam_time/gleam_time_ffi.erl
Normal file
12
build/dev/javascript/gleam_time/gleam_time_ffi.erl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-module(gleam_time_ffi).
|
||||
-export([system_time/0, local_time_offset_seconds/0]).
|
||||
|
||||
system_time() ->
|
||||
{0, erlang:system_time(nanosecond)}.
|
||||
|
||||
local_time_offset_seconds() ->
|
||||
Utc = calendar:universal_time(),
|
||||
Local = calendar:local_time(),
|
||||
UtcSeconds = calendar:datetime_to_gregorian_seconds(Utc),
|
||||
LocalSeconds = calendar:datetime_to_gregorian_seconds(Local),
|
||||
LocalSeconds - UtcSeconds.
|
||||
Loading…
Add table
Add a link
Reference in a new issue