Open Kleidukos opened 10 months ago
Unfortunately, you have to open it up with the data constructor
newtype Time = Time { getTime :: Int64 }
and then divide it by a billion. I've personally stumbled across the need for timestamps with various precisions (typically millisecond precision) several times since writing this library, and I'm not aware of a good solution to this, at least not in a way that's compatible with chronos's API.
Ok, thank you! quot ns 10^9
is good enough for me. :)
Hi, @andrewthad, I'm using cryptographic APIs that need sometimes a timestamp in seconds. Reading the API reference of Chronos it's not obvious which function I should use to convert a time or datetime object to an integer that expresses the time in seconds (instead of nanoseconds).
Is this a situation where the Torsor package is useful?