Opened 4 years ago

Closed 4 years ago

#5430 closed bug (fixed)

System.Time.formatCalendarTime: %j starts at 0 whereas strftime's %j starts at 1

Reported by: guest Owned by: igloo
Priority: normal Milestone: 7.4.1
Component: libraries/haskell98 Version: 6.12.1
Keywords: Cc: srtlg@…
Operating System: Linux Architecture: x86
Type of failure: Documentation bug Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

The documentation states

formatCalendarTime: [...] The formatting string is that understood by the ISO C strftime() function.

but the result of %j is one less as reported by strftime

I stumbled over it while using xmobar
http://code.google.com/p/xmobar/issues/detail?id=54

Change History (2)

comment:1 Changed 4 years ago by igloo

  • Owner set to igloo

comment:2 Changed 4 years ago by igloo

  • Milestone set to 7.4.1
  • Resolution set to fixed
  • Status changed from new to closed

Fixed by:

commit 3669ee6fd9cfbec4d8f3b5e5f8862b864f427b7f
Author: Ian Lynagh <[email protected]>
Date:   Fri Sep 30 12:27:06 2011 +0100

    Make %j return values in the right range; fixes #5430

    Both "struct tm" and the CalendarTime type use 000-365, but %j
    uses 001-366.
Note: See TracTickets for help on using tickets.