2010-12-29

Re: Converting date to epoch

Alexander,did you even consider that I might need to convert a date to epoch in a python script? :)

2 comments:

serverhorror said...

Errrrr......

>>> datetime.datetime.now().strftime(u'%s')
'1293705254'

?

id said...

>>> import datetime
>>> datetime.datetime.now().strftime(u'%s')
'%s'

or in other words, "%s" is not nearly universally supported. The example above was on OpenSolaris.