ISO 8601 Date time format without old-locale?

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]. What is the current method of obtaining and formatting time representation if old-locale is old? Greetings, Bram [1] A sketch of the code using old-locale: -- 2014-11-18T06:37:04+00:00 iso8601DateTimeFormat :: String iso8601DateTimeFormat = "%FT%T%z" main = do now <- getCurrentTime putStrLn $ formatTime defaultTimeLocale iso8601DateTimeFormat now Which requires "defaultTimeLocale" from the old-locale package.

On Tue, Nov 18, 2014 at 5:02 PM, Bram Neijt
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. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Tue Nov 18 2014 at 6:11:06 PM Brandon Allbery
On Tue, Nov 18, 2014 at 5:02 PM, Bram Neijt
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

On 18/11/14 20:10, Brandon Allbery wrote:
On Tue, Nov 18, 2014 at 5:02 PM, Bram Neijt
mailto:bneijt@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.
Actually, the time package has been fixed and now includes all the necessary definitions (and doesn't depend on old-locale) in version 1.5. Roman
participants (5)
-
Bram Neijt
-
Brandon Allbery
-
Nicolas DI PRIMA
-
Niklas Hambüchen
-
Roman Cheplyaka