Message127361
I would write the formatting code as follows:
('"%2d-%s-%04d %02d:%02d:%02d %+03d%02d"' %
((tt[2], _month_names[tt[1]], tt[0]) +
tt[3:6] + divmod(zone//60, 60)))
The above also assumes that month names are stored in a 1-based array:
_month_names = [None, 'Jan', ...]
Note that %2d format code takes care of space-padding.
If you think the expression that I conjured is too cryptic, get the temporal data from timetuple first with say
y, m, d, H, M, S = tt[:6]
and use named variables in the formatting expression. |
|
Date |
User |
Action |
Args |
2011-01-28 23:33:23 | belopolsky | set | recipients:
+ belopolsky, r.david.murray, lavajoe, spaetz |
2011-01-28 23:33:23 | belopolsky | set | messageid: <1296257603.74.0.701541743237.issue11024@psf.upfronthosting.co.za> |
2011-01-28 23:33:23 | belopolsky | link | issue11024 messages |
2011-01-28 23:33:23 | belopolsky | create | |
|