Initial commit
This commit is contained in:
commit
a6272848f9
379 changed files with 74829 additions and 0 deletions
11
build/dev/javascript/gleam_time/gleam_time_ffi.mjs
Normal file
11
build/dev/javascript/gleam_time/gleam_time_ffi.mjs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
export function system_time() {
|
||||
const now = Date.now();
|
||||
const milliseconds = now % 1_000;
|
||||
const nanoseconds = milliseconds * 1000_000;
|
||||
const seconds = (now - milliseconds) / 1_000;
|
||||
return [seconds, nanoseconds];
|
||||
}
|
||||
|
||||
export function local_time_offset_seconds() {
|
||||
return new Date().getTimezoneOffset() * -60;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue