Skip to content

[superseded] undeprecate toSeconds, toUnix is not a drop-in replacement #12441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/pure/times.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2703,10 +2703,10 @@ proc fromSeconds*(since1970: int64): Time
fromUnix(since1970)

proc toSeconds*(time: Time): float
{.tags: [], raises: [], benign, deprecated.} =
## Returns the time in seconds since the unix epoch.
{.tags: [], raises: [], benign.} =
## Returns the time in seconds since the unix epoch, with subsecond resolution.
##
## **Deprecated since v0.18.0:** use ``toUnix`` instead
## See also `toUnix` which has seconds resolution.
time.seconds.float + time.nanosecond / convert(Seconds, Nanoseconds, 1)

proc getLocalTime*(time: Time): DateTime
Expand Down