Message190563
pygettext uses non-standard timestamp format in the POT-Creation-Date field. For example:
POT-Creation-Date: 2013-06-03 22:31+CEST
whereas xgettext uses this format:
POT-Creation-Date: 2013-06-03 22:31+0200
You could use this code to generate timestamps in the same format as xgettext:
from time import time, localtime, strftime
from calendar import timegm
def gettext_timestamp():
now = int(time())
nowtuple = localtime(now)
offset = timegm(nowtuple) - now
sign = '-' if offset < 0 else '+'
hour, minute = divmod(abs(offset) // 60, 60)
return strftime('%Y-%m-%d %H:%M', nowtuple) + sign + '%02d%02d' % (hour, minute) |
|
Date |
User |
Action |
Args |
2013-06-03 20:51:02 | jwilk | set | recipients:
+ jwilk |
2013-06-03 20:51:02 | jwilk | set | messageid: <1370292662.79.0.797202814422.issue18128@psf.upfronthosting.co.za> |
2013-06-03 20:51:02 | jwilk | link | issue18128 messages |
2013-06-03 20:51:02 | jwilk | create | |
|