mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 12:07:51 +00:00
Merge pull request #2434 from yglukhov/epoch-time-js
Implemented epochTime function for JS target.
This commit is contained in:
@@ -541,6 +541,8 @@ elif defined(JS):
|
||||
|
||||
proc getTimezone(): int = result = newDate().getTimezoneOffset()
|
||||
|
||||
proc epochTime*(): float {.tags: [TimeEffect].} = newDate().toSeconds()
|
||||
|
||||
proc getDateStr*(): string {.rtl, extern: "nt$1", tags: [TimeEffect].} =
|
||||
## gets the current date as a string of the format ``YYYY-MM-DD``.
|
||||
var ti = getLocalTime(getTime())
|
||||
|
||||
Reference in New Issue
Block a user