Skip to the content.

Format Time String

Recipes

import time

>>> time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
'YYYY-MM-DD hh:mm:ss'

References