How to create a file name with the current date & time in Python?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While not using
datetime
, this solves your problem (answers your question) of getting a string with the current time and date format you specify:yields:
This one is much more human readable.
This prints in an easy to read format –
Output:
02_03_2021_22_44_50