lucasrodes / whatstk

WhatsApp chats as dataframes. Python toolkit to analyse and parse WhatsApp chats.
https://whatstk.lcsrg.me/
GNU General Public License v3.0
121 stars 23 forks source link

time - 12 hour clock #150

Closed Rahatrezaaa closed 2 months ago

Rahatrezaaa commented 5 months ago

Discussed in https://github.com/lucasrodes/whatstk/discussions/149

Originally posted by **Rahatrezaaa** April 16, 2024 In the dataframe, time is coming in 12 hour format, so no way to check if it is PM or AM.
lucasrodes commented 5 months ago

Hi @Rahatrezaaa, thanks fore your interest. In such circumstances, the automatic header detection can fail.

For these cases, I'd suggest using the argument hformat and specify the header format of the chat text file. Learn about it here.

tinomuzo99 commented 4 months ago

Hi I am facing this issue too. My exported file is in the form of: 2019/02/13, 4:38 am - Messages and calls are end-to-end encrypted etc... I had to specify the hformat argument: hformat='%y/%m/%d, %P:%M - %name:')

I am still running into an issue because the next error I get is the following: KeyError: "None of [Index(['date', 'username', 'message'], dtype='object')] are in the [columns]"

lucasrodes commented 3 months ago

Thanks for raising this issue. There is an issue in the documentation, which I am fixing now.

@tinomuzo99 you should use hformat '%y/%m/%d, %I:%M %P - %name:', where