Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Time in Haskell

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:

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.

Name: Anonymous 2008-11-21 21:45

>>11
That makes sense. All this time, I was imagining the getChar action returning a different value when it is called.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List