Implemented epochTime function for JS target.

This commit is contained in:
yglukhov
2015-03-30 23:53:56 +03:00
parent 3751019823
commit 9e2d6d072c

View File

@@ -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())