Converting a string to time - simple task but don't know how to do it!

Richard Kessler carner at tscnet.com
Sat Sep 14 21:12:15 CEST 2002


I have a string returned from a database expressing the time i.e. 2002-09-14
10:30:34.  I need to compare this value to the current time to determine the
amount of time elapsed between the two. I get the current time using
time.time() but I cannot find a way to convert the string from the database
into a time value (seconds from epoch) to do the simple subraction to find
seconds elapsed.

Help please...from anyone knowing how to do this simple task.

Thanks very much in advance.

Richard





More information about the Python-list mailing list