[Tutor] Re: Time Function [strftime / strptime]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 9 Jun 2002 00:33:58 -0700 (PDT)


On Sat, 8 Jun 2002, Chris Avery wrote:

> time.strftime() returns the time you want.
> time.strftime("%h-%m") or something like that should work.

By the way, you may find this post useful:

http://groups.google.com/groups?selm=mailman.1023213423.29408.clpa-moderators%40python.org

time.strptime() is the function that does the inverse of strftime(): it
reads date strings back into the "epoch seconds" that Python can easily
work with... but it appears to be available only on Unix systems.

However, the message above refers to a pure Python implementation of the
time.strptime() function, so if you ever need to use it in a non-Unix
environment, this might be useful.


Good luck!