On Sep 19, 9:22 pm, Schif Schaf <schifsc...@gmail.com> wrote: > The other day I needed to convert a date like "August 2009" into a > "seconds-since-epoch" value (this would be for the first day of that > month, at the first second of that day). > > In Python, I came up with this: > > ~~~~ > #!/usr/bin/env python > > import datetime > import time > > time_in_sse = time.mktime( > datetime.datetime(2009, 8, 1).timetuple() > )
(datetime.datetime(2009, 8, 1) - datetime.datetime(1970, 1, 1)).days * 86400 But still, this should be part of the datetime class. -- http://mail.python.org/mailman/listinfo/python-list