You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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.
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?
The text was updated successfully, but these errors were encountered: