Mercurial > babel > old > mirror
comparison babel/messages/catalog.py @ 123:5b4f302abf53
Fix parsing of timezone in POT creation date.
author | cmlenz |
---|---|
date | Fri, 15 Jun 2007 22:58:46 +0000 |
parents | 03f106700f02 |
children | 9d58665d134c |
comparison
equal
deleted
inserted
replaced
122:03f106700f02 | 123:5b4f302abf53 |
---|---|
256 value, tzoffset, _ = re.split('[+-](\d{4})$', value, 1) | 256 value, tzoffset, _ = re.split('[+-](\d{4})$', value, 1) |
257 tt = time.strptime(value, '%Y-%m-%d %H:%M') | 257 tt = time.strptime(value, '%Y-%m-%d %H:%M') |
258 ts = time.mktime(tt) | 258 ts = time.mktime(tt) |
259 tzoffset = FixedOffsetTimezone(int(tzoffset[:2]) * 60 + | 259 tzoffset = FixedOffsetTimezone(int(tzoffset[:2]) * 60 + |
260 int(tzoffset[2:])) | 260 int(tzoffset[2:])) |
261 self.creation_date = datetime.fromtimestamp(ts, tzoffset) | 261 dt = datetime.fromtimestamp(ts) |
262 self.creation_date = dt.replace(tzinfo=tzoffset) | |
262 | 263 |
263 mime_headers = property(_get_mime_headers, _set_mime_headers, doc="""\ | 264 mime_headers = property(_get_mime_headers, _set_mime_headers, doc="""\ |
264 The MIME headers of the catalog, used for the special ``msgid ""`` entry. | 265 The MIME headers of the catalog, used for the special ``msgid ""`` entry. |
265 | 266 |
266 The behavior of this property changes slightly depending on whether a locale | 267 The behavior of this property changes slightly depending on whether a locale |