=================================

Python - How to get current date time and format its output | DzQ39 |

This is a quick summary of how to get the current date and time and format its output in Python.

The Code

import datetime
print datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

The Result


Reference:

Comments