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
It would be nice if there was some sort of API that could add some time unit to a Posix time, for instance to get the time 5 hours from some input Posix time. The advantage being that developers wouldn't need to convert Posix to milliseconds, add the time, and convert back to Posix. Additionally, developers wouldn't need to lookup the number of milliseconds in their desired time increment. I'm imagining something akin to
offsetSeconds : Int -> Posix -> Posix
offsetMinutes : Int -> Posix -> Posix
offsetHours : Int -> Posix -> Posix
offsetDays : Int -> Posix -> Posix
where int can be either positive or negative. Additionally, pipeline syntax could be used to produce combinations of time units, for instance:
addHourThirty : Posix -> Posix
addHourThirty t =
t
|> offsetHours 1
|> offsetMinutes 30
If this is indeed a feature the community is interested in, I'd be happy to develop it (shouldn't be too difficult).
The text was updated successfully, but these errors were encountered:
It would be nice if there was some sort of API that could add some time unit to a Posix time, for instance to get the time 5 hours from some input Posix time. The advantage being that developers wouldn't need to convert Posix to milliseconds, add the time, and convert back to Posix. Additionally, developers wouldn't need to lookup the number of milliseconds in their desired time increment. I'm imagining something akin to
where int can be either positive or negative. Additionally, pipeline syntax could be used to produce combinations of time units, for instance:
If this is indeed a feature the community is interested in, I'd be happy to develop it (shouldn't be too difficult).
The text was updated successfully, but these errors were encountered: