Ticket #2671 (closed bug: fixed)

Opened 5 years ago

Last modified 2 years ago

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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

$ 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

Changed 5 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

Changed 5 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

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • description modified (diff)

Changed 5 years ago by igloo

  • component changed from libraries/base to libraries (other)
  • milestone set to 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).

Changed 5 years ago by simonmic

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

Changed 2 years ago by igloo

  • failure set to None/Unknown
  • milestone changed from Not GHC to 7.2.1

Still happens with time-1.2.0.4.

Changed 2 years ago by igloo

  • owner set to ashley@…
  • description modified (diff)

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

Changed 2 years ago by Ashley Yakeley

  • status changed from new to merge

Fixed in time-1.2.0.5.

Changed 2 years ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

We now have time-1.2.0.5.

Note: See TracTickets for help on using tickets.