mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-28 22:03:30 +03:00
now_since_unix_epoch_ms
now uses negative dates for times pre Unix-epoch
This commit is contained in:
parent
1eae74eb54
commit
9245e3458f
@ -16,10 +16,10 @@ pub fn now_since_unix_epoch_ms() -> i64 {
|
||||
.elapsed()
|
||||
.map(|d| i64::try_from(d.as_millis()).expect("no system date is this far in the future"))
|
||||
.unwrap_or_else(|_| {
|
||||
i64::try_from(
|
||||
-i64::try_from(
|
||||
UNIX_EPOCH
|
||||
.duration_since(std::time::SystemTime::now())
|
||||
.expect("a date in the past")
|
||||
.expect("'now' is in the past")
|
||||
.as_millis(),
|
||||
)
|
||||
.expect("no time is that far in the past")
|
||||
|
Loading…
Reference in New Issue
Block a user