Added ::MIN ::MAX DateTime. (#1965)

This commit is contained in:
Paul Masurel
2023-03-27 15:32:53 +09:00
committed by GitHub
parent 694a056255
commit 059fc767ea

View File

@@ -36,6 +36,16 @@ pub struct DateTime {
}
impl DateTime {
/// Minimum possible `DateTime` value.
pub const MIN: DateTime = DateTime {
timestamp_micros: i64::MIN,
};
/// Maximum possible `DateTime` value.
pub const MAX: DateTime = DateTime {
timestamp_micros: i64::MAX,
};
/// Create new from UNIX timestamp in seconds
pub const fn from_timestamp_secs(seconds: i64) -> Self {
Self {