mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +00:00
Improve deprecation comments in times module
This commit is contained in:
@@ -1353,20 +1353,20 @@ proc fromSeconds*(since1970: float): Time {.tags: [], raises: [], benign, deprec
|
||||
## Takes a float which contains the number of seconds since the unix epoch and
|
||||
## returns a time object.
|
||||
##
|
||||
## **Deprecated since v0.18.0:** use ``Time`` instead
|
||||
## **Deprecated since v0.18.0:** use ``fromUnix`` instead
|
||||
Time(since1970)
|
||||
|
||||
proc fromSeconds*(since1970: int64): Time {.tags: [], raises: [], benign, deprecated.} =
|
||||
## Takes an int which contains the number of seconds since the unix epoch and
|
||||
## returns a time object.
|
||||
##
|
||||
## **Deprecated since v0.18.0:** use ``Time`` instead
|
||||
## **Deprecated since v0.18.0:** use ``fromUnix`` instead
|
||||
Time(since1970)
|
||||
|
||||
proc toSeconds*(time: Time): float {.tags: [], raises: [], benign, deprecated.} =
|
||||
## Returns the time in seconds since the unix epoch.
|
||||
##
|
||||
## **Deprecated since v0.18.0:** use ``float`` instead
|
||||
## **Deprecated since v0.18.0:** use ``toUnix`` instead
|
||||
float(time)
|
||||
|
||||
proc getLocalTime*(time: Time): DateTime {.tags: [], raises: [], benign, deprecated.} =
|
||||
@@ -1385,6 +1385,9 @@ proc getGMTime*(time: Time): DateTime {.tags: [], raises: [], benign, deprecated
|
||||
|
||||
proc getTimezone*(): int {.tags: [TimeEffect], raises: [], benign, deprecated.} =
|
||||
## Returns the offset of the local (non-DST) timezone in seconds west of UTC.
|
||||
##
|
||||
## **Deprecated since v0.18.0:** use ``now().utcOffset`` to get the current
|
||||
## utc offset (including DST).
|
||||
when defined(JS):
|
||||
return newDate().getTimezoneOffset() * 60
|
||||
elif defined(freebsd) or defined(netbsd) or defined(openbsd):
|
||||
|
||||
Reference in New Issue
Block a user