Merge pull request #2434 from yglukhov/epoch-time-js

Implemented epochTime function for JS target.
This commit is contained in:
Dominik Picheta
2015-03-31 00:49:30 +01:00

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