Home > Mobile >  datetime in pandas showing the wrong value
datetime in pandas showing the wrong value

Time:08-15

import numpy as np
import pandas as pd
from datetime import datetime

Made variables assigned with the time:
year_= 2019
month_= 8
day_= 7
hour_= 6
sec_= 15

time_= datetime(year_,month_,day_,hour_,sec_)

But when i call time_.second it returns 0 in jupyter notebook

time_.second
0

CodePudding user response:

This is because the 5th number is minutes. Not seconds.

Try:

year_= 2019
month_= 8
day_= 7
hour_= 6
min_ = 34
sec_= 15

time_= datetime(year_,month_,day_,hour_,min_,sec_)
time_.second
15

I have added the figure for minutes.

  • Related