On Fri, 22 Jul 2022, 23:37 Prashanth Patelc, <prashanthpat...@gmail.com>
wrote:

> 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
>
> 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
>
>
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMCU6CpwW9q9z_pBdgf%3Do5dEzvET5qqvddopjNQtGwuxm5RUjA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMCU6CpwW9q9z_pBdgf%3Do5dEzvET5qqvddopjNQtGwuxm5RUjA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN-6G3xoKQ4g5a8LtTGGwPJw1LSVXK2aGNwKcDKAHqsV0mb%3DKA%40mail.gmail.com.

Reply via email to