[Tutor] can time.time() be reversed so as to get date?

Shashwat Anand anand.shashwat at gmail.com
Fri Nov 6 18:37:10 CET 2009


Problem resolved.

time.ctime(no_of_seconds - 330*60) does it.
330*60, because my time-zone is GMT+5:30 and time.ctime() gives the local
time while I wanted the GMT.

On Fri, Nov 6, 2009 at 10:00 PM, Shashwat Anand <anand.shashwat at gmail.com>wrote:

> If I have been given the number of seconds from midnight 1970.01.01 GMT,
> can I calculate the date, month and time in the following format : 'Fri Nov
> 6 9:58:16 2009' ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091106/66fbe463/attachment.htm>


More information about the Tutor mailing list