Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python add datetime to filename

from datetime import datetime

date = datetime.now().strftime("%Y_%m_%d-%I:%M:%S_%p")
print(f"filename_{date}")

'filename_2020_08_12-03:29:22_AM'
Comment

PREVIOUS NEXT
Code Example
Python :: Unable to locate package python-certbot-nginx 
Python :: convert date time to date pandas 
Python :: python reload import 
Python :: python reload function in shell 
Python :: random boolean python 
Python :: instal cython 
Python :: export dataframe to csv python 
Python :: how to print hello world 10 times in python 
Python :: correlation plot python seaborn 
Python :: open link from python 
Python :: python find smallest element in dictionary 
Python :: long to_bytes python how to use it 
Python :: Cannot convert non-finite values (NA or inf) to integer 
Python :: python flask sample application 
Python :: Flask Gmail 
Python :: download python on wsl 
Python :: get_object_or_404 
Python :: pyqt5 set window icon 
Python :: python how to flatten a list 
Python :: keras model load 
Python :: how to get the system time in python 
Python :: show image in python 
Python :: pandas read_csv ignore unnamed columns 
Python :: python shebang line 
Python :: count number of matrix islands python 
Python :: dataframe from two series 
Python :: django makemigrations comand 
Python :: python get newest file in directory 
Python :: colab cuda version 
Python :: read file line by line into list 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =