Name: Anonymous 2008-11-21 7:41
What's the best way of handling time and date values in Haskell? I did it once, but I had to use a horrible mix of timestamps, UTC time, local time, and convert all the time:
The timestamps are for serialization to a file (or perhaps I'm using a SQLite DB).
Any nice Hackage packages or some super module that can handle everything? Well, for my current project I only need conversion to UNIX timestamps and some kind of parsing perhaps.
import Data.Time.Format (formatTime)
import System.Locale (defaultTimeLocale)
import Data.Time.Clock.POSIX (getPOSIXTime, posixSecondsToUTCTime, utcTimeToPOSIXSeconds)
import Data.Time.Clock (addUTCTime, diffUTCTime, UTCTime(..))The timestamps are for serialization to a file (or perhaps I'm using a SQLite DB).
Any nice Hackage packages or some super module that can handle everything? Well, for my current project I only need conversion to UNIX timestamps and some kind of parsing perhaps.