Add warnings about deprecation to times module (#7001)
* Add warnings about deprecation to times module I've added warnings about some procedures being deprecated. Also I can't find what is the replacement for `getTimezone` proc, please help with that * Update times.nim * Update times.nim
This commit is contained in:
parent
3714e2f871
commit
a521f98392
1 changed files with 12 additions and 2 deletions
|
|
@ -1352,25 +1352,35 @@ else:
|
|||
proc fromSeconds*(since1970: float): Time {.tags: [], raises: [], benign, deprecated.} =
|
||||
## 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
|
||||
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
|
||||
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
|
||||
float(time)
|
||||
|
||||
proc getLocalTime*(time: Time): DateTime {.tags: [], raises: [], benign, deprecated.} =
|
||||
## Converts the calendar time `time` to broken-time representation,
|
||||
## expressed relative to the user's specified time zone.
|
||||
##
|
||||
## **Deprecated since v0.18.0:** use ``local`` instead
|
||||
time.local
|
||||
|
||||
proc getGMTime*(time: Time): DateTime {.tags: [], raises: [], benign, deprecated.} =
|
||||
## Converts the calendar time `time` to broken-down time representation,
|
||||
## expressed in Coordinated Universal Time (UTC).
|
||||
## expressed in Coordinated Universal Time (UTC).
|
||||
##
|
||||
## **Deprecated since v0.18.0:** use ``utc`` instead
|
||||
time.utc
|
||||
|
||||
proc getTimezone*(): int {.tags: [TimeEffect], raises: [], benign, deprecated.} =
|
||||
|
|
@ -1468,4 +1478,4 @@ proc getDayOfWeekJulian*(day, month, year: int): WeekDay {.deprecated.} =
|
|||
y = year - a
|
||||
m = month + (12*a) - 2
|
||||
d = (5 + day + y + (y div 4) + (31*m) div 12) mod 7
|
||||
result = d.WeekDay
|
||||
result = d.WeekDay
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue