[Haskell-cafe] ISO 8601 Date time format without old-locale?

Nicolas DI PRIMA nicolasdiprima at gmail.com
Tue Nov 18 22:14:12 UTC 2014


On Tue Nov 18 2014 at 6:11:06 PM Brandon Allbery <allbery.b at gmail.com>
wrote:

> On Tue, Nov 18, 2014 at 5:02 PM, Bram Neijt <bneijt at gmail.com> wrote:
>
>> I want to do ISO8601 formatting of a date with a numeric zone offset
>> and I can't seem to find a way of doing it without requiring the
>> old-locale package[1].
>>
>
> Use old-locale. It was inappropriately deprecated with no replacement, and
> nobody seems to want to bother either fixing or replacing it.
>
>
You also can use hourglass (http://hackage.haskell.org/package/hourglass).
I think it is a good replacement to 'time'.
It also provides the ISO8601 Time format you need (see example below). I
hope this will help you.

import Data.Hourglass
import System.Hourglass

main :: IO ()
main = do
    tc <- timeCurrent
    putStrLn $ timePrint ISO8601_DateAndTime tc
> 2014-11-18T22:06:50+00:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141118/47fae7a8/attachment.html>


More information about the Haskell-Cafe mailing list