mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-05 17:15:19 +03:00
Merge pull request #3858 from Byron/quick-fix
`now_since_unix_epoch_ms` now uses negative dates for times pre Unix-epoch
This commit is contained in:
commit
1dc8988c3c
@ -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