Edgewall Software
Modify

Opened 21 years ago

Closed 21 years ago

#120 closed defect (fixed)

non-portable use of strftime

Reported by: anonymous Owned by: daniel
Priority: normal Milestone:
Component: general Version: 0.5.2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

In several places, function strftime is used with the %F and %R format code. However, those two format codes are non-standard and thus to be considered implementation-dependent. In particular, both codes are not supported on the Win32 platform. It might be better to replace the hard-coded string literals '%F' and '%R' with configuration variables that could be used to customize the date and time format.

Attachments (0)

Change History (2)

comment:1 by daniel, 21 years ago

Owner: changed from Jonas Borgström to daniel
Status: newassigned

Indeed, the time formatting is inconsistent and hardcoded. While once solution is certainly to offer a customizable time format string (or similar), that would require more settings/configuring.

I think it's better to go the the system's locale, since that's (on UNIX at least) set simply by environment variables. So if you wish to run Trac using a different locale than the system-default, just change the environment for the server/cgi.

If I'm dead wrong here, we can change it later. It'll still be better than the buggy way we do it now. :-)

Thank you for the report, it was very helpful.

/d

comment:2 by daniel, 21 years ago

Resolution: fixed
Status: assignedclosed

In [241], I changed all the %F and %R to locale-specific (and portable) %x, %X and %c .

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain daniel.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from daniel to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.