I am trying to identify hours between two dates. Date format is not consistent between two columns
The below code works when the date format is similar. How can I convert the UTC date format into normal date month year
df['timebetween'] = (pd.to_datetime(df['datecolA'],dayfirst = True) - pd.to_datetime(df['datecolB'],dayfirst = True))
df['timebetween']= df['timebetween']/np.timedelta64(1,'h')
my data looks like below and I am interested in column timebetween which can be achieved from the above code if both date columns had same format
datecolA datecolB timebetween
29/06/2020 08:30:00 2018-12-02T11:32:00.000Z x hours
29/06/2020 08:30:00 2018-12-04T14:00:00.000Z y hours
29/06/2020 08:30:00 2017-02-02T14:36:00.000Z z hours
29/06/2020 08:30:00 2017-02-02T14:36:00.000Z n hours