Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to add 30 minutes in datetime column in pandas

df['time'] = pd.to_datetime(df['time'].astype(str)) + pd.DateOffset(hours=5, minutes=30)

print(df['time'].head())

0   2018-12-24 10:20:00
1   2018-12-24 10:20:00
2   2018-12-24 10:30:00
3   2018-12-24 10:42:00
4   2018-12-24 11:34:00
Name: 1, dtype: datetime64[ns]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #minutes #datetime #column #pandas
ADD COMMENT
Topic
Name
8+6 =