mccutchen / strftime.org

A single-serving-site that provides a reference for Python's strftime formatting options
https://strftime.org/
584 stars 307 forks source link

Note about %z gotcha #9

Open asmeurer opened 10 years ago

asmeurer commented 10 years ago

This is a good opportunity to improve on the python.org docs. An issue I've seen is that %z does unexpected things on Windows (http://bugs.python.org/issue20010). Instead of returning +HHHH it returns a string name of the time zone (often with Unicode characters). Code that uses it is liable to break when run in Windows.

mccutchen commented 10 years ago

@asmeurer I'm not familiar enough with this bug to feel very confident in writing a useful warning, feel like submitting a pull request?

It might be a little tricky, as strftime.org is built by extracting the formatting table from the live Python docs, but it might make sense to have a sort of generic facility for adding extra annotations to any of the entries in that table.

asmeurer commented 10 years ago

The issue is primarily that the output is different. For me, on Windows 8, time.strftime('%z') gives 'Central Daylight Time' (as is %Z).

The bug I'm not as sure about. See https://github.com/conda/conda/issues/651 for an example of it. I think some time zone names have strange unicode characters (in this case, it was a curly quote ).