Opened 8 years ago

Closed 8 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 Rev(s):
Wiki Page:


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

Change History (2)

comment:1 Changed 8 years ago by igloo

Owner: set to igloo

comment:2 Changed 8 years ago by igloo

Milestone: 7.4.1
Resolution: fixed
Status: newclosed

Fixed by:

commit 3669ee6fd9cfbec4d8f3b5e5f8862b864f427b7f
Author: Ian Lynagh <>
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.