how to use time in pandas (convert 24 hours time to 12 hours)
Login time table
==========
userid logindate logintime
2 2022-13-07 18:30:00.490337
Logout time table
==========
userid logindate logintime
2 2022-14-07 02:36:03.450327
output:
login_date user__username user diiffrences
0 2022-07-14 neil neil -1 days +07:26:47.027887
0 2022-07-14 neil neil -1 days +07:26:47.027887
How to convert above atbles time: ?
nee output like this type
==============
login_date user__username user diiffrences
0 2022-07-14 neil neil 08:03:47.027887
0 2022-07-14 neil neil 08:03:47.027887
df['logout_time'] = pd.to_timedelta(df['logout_time'].astype(str))
df['login_time'] = pd.to_timedelta(df['login_time'].astype(str))
df['diiffrences'] = df['logout_time'] - df['login_time']
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMCU6CpwW9q9z_pBdgf%3Do5dEzvET5qqvddopjNQtGwuxm5RUjA%40mail.gmail.com.
No comments:
Post a Comment