Revision 844
Added by Aaron Marcuse-Kubitza almost 13 years ago
lib/dates.py | ||
---|---|---|
9 | 9 |
|
10 | 10 |
def strftime(format, datetime_): |
11 | 11 |
'''datetime.strftime() can't handle years before 1900''' |
12 |
return datetime_.replace(year=epoch_year).strftime(format.replace('%Y', |
|
13 |
'%%Y')).replace('%Y', str(datetime_.year)) |
|
12 |
return (datetime_.replace(year=epoch_year, day=1).strftime( |
|
13 |
format.replace('%Y', '%%Y').replace('%d', '%%d')) |
|
14 |
.replace('%Y', str(datetime_.year)).replace('%d', str(datetime_.day))) |
Also available in: Unified diff
dates.py: Work around strftime() bug that can't deal with 2/29 on a leap year