how to remove microseconds from datetime in python

>>>"%Y-%m-%d %H:%M:%S")
'2011-11-03 18:21:26'

Here is what the above code is Doing:
1. The first line imports the datetime module.
2. The second line creates a datetime object.
3. The third line formats the datetime object into a string.
4. The fourth line prints the string.