Datetime format

Emmie Wawa wrote:

But i only want the format to be 2008-06-05 08:45:58 because only these
match the mysql datetime format. Is there other way of do the parsing?



You can output the datetime in any format you desire using the strftime method. Off the top of my head, something like this may do the trick:

date.strftime('%Y-%m-%d %H:%M:%S)

for usage in db you can do:


this will output any DateTime for use with SQL