I’d like to convert a unix timestamp (represented as a Core.Int64.t) to a Core.Time.t. This seems like it should be easy, and I feel embarrassed even asking, but there’s no obvious Core.Time.of_int64 function, or something similar.
My guess is that I can hack this functionality by using the binary serialization interface… but that doesn’t feel very idiomatic. Is there a better way?
Just to be clear, I’m looking for some function f such that:
What is the semantics of the transformation you’re looking for? Do you want to count the integer number of seconds since the epoch? The answer to that determines how you do the transformation.