mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-27 20:42:54 +00:00
Added ::MIN ::MAX DateTime. (#1965)
This commit is contained in:
@@ -36,6 +36,16 @@ pub struct DateTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl 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
|
/// Create new from UNIX timestamp in seconds
|
||||||
pub const fn from_timestamp_secs(seconds: i64) -> Self {
|
pub const fn from_timestamp_secs(seconds: i64) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user