Python: Get current date and time

To get current date and time Python offers “datetime”. To format the output according to your needs you can use “strftime”, otherwise a month would for example be shown as 8 instead of 08.

Sample outputs: