On 08/24/2015 07:34 AM, Peter Wetz wrote:
okay, sorry for the spam, but I already wrapped my head around how to change the date format.
just use python's functionality to parse it into a different string. for instance: 'date': datetime.datetime.strptime(article.datestr, "%a, %d %b %Y %H:%M:%S %z").strftime("%d %b %Y %H:%M:%S"),
Or, perhaps a bit simpler:
'date': datetime.datetime.fromtimestamp(article.date).strftime("%d %b %Y %H:%M:%S")
or simpler still and not requiring import of datetime (HyperArch.py already imports time
'date': time.strftime("%d %b %Y %H:%M:%S", time.localtime(article.date))
Note that the article instance has attributes
# datestr : The posting date, in human-readable format # date : The posting date, in purely numeric format
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan