purescript-codec-argonaut icon indicating copy to clipboard operation
purescript-codec-argonaut copied to clipboard

Prefered way to encode DateTime

Open wclr opened this issue 3 years ago • 1 comments

How would you advise to work with DataTime from the core package and codecs, is the preferred way would be to convert it to Milliseconds using unInstant $ Instant.fromDate date and convert it back using Instant.toDateTime?

wclr avatar May 18 '21 10:05 wclr

I'd say "it depends" - which is why this library doesn't provide codecs for the datetime library. If you're dealing with an external API that representation might not be suitable. If you don't care about the specifics of the representation then yeah, dimapping via Instant is probably the easiest definition.

garyb avatar May 18 '21 10:05 garyb