Closed ianmackenzie closed 3 years ago
Hi Ian,
I noticed that dmy/elm-imf-date-time was recently published, which parses such formats. Perhaps that may help.
Justin
Thanks Justin, very timely! Anything by @dmy is definitely worth checking out =)
Perhaps more relevantly to this specific issue, though, I see that elm-imf-date-time
uses Time.Extra.partsToPosix
from your own time-extra
package - that's exactly the functionality I was looking for, and somehow I missed it when I was looking at different date/time packages.
So I think this issue can probably be closed since the functionality I was describing is in fact available in the time-extra
package (thanks!), and now that elm-imf-date-time
is published for my particular use case I can just switch to that myself and get rid of my parsing code as well.
@rtfeldman can you close this issue when you have time since it seems to be resolved now? 😄
I'm trying to parse dates/times from the
Last-Modified
header of an HTTP response. It's easy enough to write a parser to extract the year, month, day, hour, minute and second (certainly helps that the time is guaranteed to always be in GMT/UTC). However, if I want to convert that to aTime.Posix
value, the options currently all seem a bit messy:Last-Modified
string, construct the equivalent ISO8601 string, then parse that with this package (some unnecessary parsing and one more place for bugs to creep in)dateTime
andtoPosix
from theisaacseymour/deprecated-time
package, which is not recommended for use in new codeyearMonthDay
function and probably a few other internal helpers from this package into my own projectWould it make sense to take the core logic of dealing with month lengths, leap years etc. and either expose it from this package or (perhaps better) publish it as a separate package that
elm-iso8601-data-strings
could then depend on?