Implemented epochTime function for JS target.
This commit is contained in:
parent
3751019823
commit
9e2d6d072c
1 changed files with 2 additions and 0 deletions
|
|
@ -541,6 +541,8 @@ elif defined(JS):
|
||||||
|
|
||||||
proc getTimezone(): int = result = newDate().getTimezoneOffset()
|
proc getTimezone(): int = result = newDate().getTimezoneOffset()
|
||||||
|
|
||||||
|
proc epochTime*(): float {.tags: [TimeEffect].} = newDate().toSeconds()
|
||||||
|
|
||||||
proc getDateStr*(): string {.rtl, extern: "nt$1", tags: [TimeEffect].} =
|
proc getDateStr*(): string {.rtl, extern: "nt$1", tags: [TimeEffect].} =
|
||||||
## gets the current date as a string of the format ``YYYY-MM-DD``.
|
## gets the current date as a string of the format ``YYYY-MM-DD``.
|
||||||
var ti = getLocalTime(getTime())
|
var ti = getLocalTime(getTime())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue