Merge pull request #4599 from urbit/jo/zuse-time-unfix

zuse: fix time fix regression
This commit is contained in:
Jōshin 2021-03-12 19:26:51 -08:00 committed by GitHub
commit 386949808b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -5535,7 +5535,8 @@
:: :: ++unm:chrono:userlib
++ unm :: Urbit to Unix ms
|= a=@da
(div (mul (sub a ~1970.1.1) 1.000) ~s1)
=- (div (mul - 1.000) ~s1)
(sub (add a (div ~s1 2.000)) ~1970.1.1)
:: :: ++unt:chrono:userlib
++ unt :: Urbit to Unix time
|= a=@da

View File

@ -179,6 +179,11 @@
%+ expect-eq
!> [%n '1000']
!> (time ~1970.1.1..0.0.1)
:: timestamps should invert
::
%+ expect-eq
!> [%n '1001']
!> (time (from-unix-ms:chrono:userlib 1.001))
:: ship - store ship identity as a string
::
%+ expect-eq