Huh.  I should have read your message more closely.  Sorry; it's been
one of those days for me, it seems...

Anyway, can you use ctime()?  It looks like that might be almost right:

    >>> t = 1411167038
    >>> datetime.datetime.utcfromtimestamp(t).ctime()
    'Fri Sep 19 22:50:38 2014'

though if you really do want more control over what's being printed,
yes, strftime() is what's you're looking for, I think:

    >>> t = 1411167038
    >>> datetime.datetime.utcfromtimestamp(t).strftime("%a, %d %b %Y %H:%M:%S")
    'Fri, 19 Sep 2014 22:50:38'

https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to