Skip to content

Tracking Issue for SystemTime::MIN and SystemTime::MAX #149067

Open

Description

@cvengler

Feature gate: #![feature(time_systemtime_limits)]

This is a tracking issue for rust-lang/libs-team#692

Public API

use std::time::{Duration, SystemTime};

// Adding the smallest possible Duration to SystemTime::MAX shall fail ...
assert!(SystemTime::MAX.checked_add(Duration::new(0, 1)).is_none());

// ... whereas subtracting it shall be fine.
assert!(SystemTime::MAX.checked_sub(Duration::new(0, 1)).is_some());

// Subtracting the smallest possible Duration from SystemTime::MIN shall fail ...
assert!(SystemTime::MIN.checked_sub(Duration::new(0, 1)).is_none());

// ... whereas adding it shall be fine.
assert!(SystemTime::MIN.checked_add(Duration::new(0, 1)).is_some());

Steps / History

Unresolved Questions

  • What should the bounds be on 32-bit platforms? See discussion in Add SystemTime::{MIN, MAX} #148825 (comment). Maybe better resolved by using 64-bit wide APIs on 32-bit platforms (such as __clock_gettime64 or clock_gettime_nsec_np)

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    T-libs-api[DEPRECATED; DO NOT USE]
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Nov 18, 2025
  2. added a commit that references this issue on Dec 11, 2025
  3. added a commit that references this issue on Dec 12, 2025
  4. added a commit that references this issue on Dec 13, 2025
  5. added 2 commits that reference this issue on Dec 13, 2025
  6. added 3 commits that reference this issue on Dec 14, 2025
  7. added a commit that references this issue on Dec 14, 2025
  8. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    T-libs-api[DEPRECATED; DO NOT USE]
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions