Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

remove minutes and seconds from datetime python

old_date = datetime.datetime(2011, 3, 23, 16, 45)
new_date = old_date.replace(minute=0, second=0) + datetime.timedelta(hours=1)
Comment

PREVIOUS NEXT
Code Example
Python :: python change cwd to script directory 
Python :: max of a dict 
Python :: python live radio 
Python :: append a line to a text file python 
Python :: get n items from dictionary python 
Python :: python dataframe get numeric columns 
Python :: python iterate letters 
Python :: python list distinct 
Python :: find null value for a particular column in dataframe 
Python :: Concatenate strings using Pandas groupby 
Python :: discord bot python meme command 
Python :: how to iterate pandas dataframe 
Python :: perfect number program in python 
Python :: how to replace nan values with 0 in pandas 
Python :: python column = sum of list of columns 
Python :: for loop with zip and enumerate 
Python :: why men are better than woman 
Python :: python clock 
Python :: find the number of nan per column pandas 
Python :: python read lines from text file 
Python :: Violin Plots in Seaborn 
Python :: how to import subprocess in python 
Python :: python print without leading whitespace 
Python :: numpy arrays equality 
Python :: python time in nanoseconds 
Python :: how to make a function to choose random things in python 
Python :: add a column while iterating rows pandas 
Python :: python check if type 
Python :: parse list from string 
Python :: django rest framework simple jwt 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =