Opened 22 years ago
Closed 22 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 , 22 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
In [241], I changed all the %F and %R to locale-specific (and portable) %x, %X and %c .



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.