Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing fuzzy dates in Haskell (or C)

Is there a good library for parsing dates from a string in Haskell or ANSI C? Something like PHP's strtotime, or Ruby's Time.parse or Chronic, or whatever.

If it can parse "next week", etc, then that's ideal, but even if it can just figure out for itself what format a complete date string is in and return the result, that would be good enough.

I'd really rather not port Chronic or extract strototime by hand...

like image 339
singpolyma Avatar asked Mar 22 '12 23:03

singpolyma


1 Answers

After much hunting, I discovered that the date code in Git is pretty good and not very dependent on the rest of Git, so I pulled it out and made http://hackage.haskell.org/package/git-date

I'm willing to use a better solution if there is one :)

like image 95
singpolyma Avatar answered Oct 06 '22 00:10

singpolyma