Am I doing this wrong? Why does this seem so clumsy (time, datetime vs. DateTime)

Skye Shaw!@#$ skye.shaw at gmail.com
Sun Sep 20 06:19:31 CEST 2009


On Sep 19, 7:22 pm, Schif Schaf <schifsc... at 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).

You could use Time::Piece:

[sshaw at localhost ~]$ perl -lMTime::Piece -e'$t=Time::Piece->strptime
("August 2009","%b %Y"); print $t->epoch'
1249084800



More information about the Python-list mailing list