human
Python datetime to string without microsecond component
assistant
Here is some code to formate current date and time to a string using pattern '%Y-%m-%d %H:%M:%S'

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

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.