WeCodeAcademy

Get the current date and time

datetime.now() gives the time; strftime formats it. Here a fixed date keeps the output stable.

Examplepython
Open in editor »

More Python recipes