Opened 11 years ago

Closed 9 years ago

#2671 closed bug (fixed)

Data.Time.Clock parseTime's %y parses "08" as 1908

Reported by: simonmic Owned by: ashley@…
Priority: normal Milestone: 7.2.1
Component: libraries (other) Version: 6.8.2
Keywords: time Cc: simon@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by igloo)

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
$ ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude>
Prelude> :m + System.Locale Data.Time.Clock Data.Time.Format
Prelude Data.Time.Format Data.Time.Clock System.Locale> parseTime defaultTimeLocale "%y" "08" :: Maybe UTCTime
Loading package old-locale-1.0.0.0 ... linking ... done.
Loading package time-1.1.2.0 ... linking ... done.
Just 1908-01-01 00:00:00 UTC

Change History (9)

comment:1 Changed 11 years ago by simonmic

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
$ ghci
Prelude> :m + System.Locale Data.Time.Clock Data.Time.Format
Prelude Data.Time.Format Data.Time.Clock System.Locale> parseTime defaultTimeLocale "%y" "08" :: Ma$
Just 1908-01-01 00:00:00 UTC

comment:2 Changed 11 years ago by simonmic

Gaah.. one more time

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
Prelude> :m + System.Locale Data.Time.Clock Data.Time.Format
Prelude Data.Time.Format Data.Time.Clock System.Locale> parseTime defaultTimeLocale "%y" "08" :: Maybe UTCTime
Just 1908-01-01 00:00:00 UTC

comment:3 Changed 11 years ago by igloo

Description: modified (diff)
difficulty: Unknown

comment:4 Changed 11 years ago by igloo

Component: libraries/baselibraries (other)
Milestone: Not GHC

My strptime(3) manpage says:

       %y     The year within century (0-99).  When a century is not otherwise
              specified, values in the range 69-99 refer to years in the twen‐
              tieth century (1969-1999); values in the range  00-68  refer  to
              years in the twenty-first century (2000-2068).

comment:5 Changed 11 years ago by simonmic

I see this on both mac osx leopard and ubuntu hardy.

comment:6 Changed 9 years ago by igloo

Milestone: Not GHC7.2.1
Type of failure: None/Unknown

Still happens with time-1.2.0.4.

comment:7 Changed 9 years ago by igloo

Description: modified (diff)
Owner: set to ashley@…

Ashley, any chance you could take a look at this please?

comment:8 Changed 9 years ago by Ashley Yakeley

Status: newmerge

Fixed in time-1.2.0.5.

comment:9 Changed 9 years ago by igloo

Resolution: fixed
Status: mergeclosed

We now have time-1.2.0.5.

Note: See TracTickets for help on using tickets.