KnugiHK / WhatsApp-Chat-Exporter

A customizable Android and iOS/iPadOS WhatsApp database parser that will give you the history of your WhatsApp conversations in HTML and JSON. Android Backup Crypt12, Crypt14, Crypt15, and new schema supported.
https://wts.knugi.dev/
MIT License
518 stars 76 forks source link

iOS messages on a specific day erroneously have the same time in html #64

Closed juliuspfadt closed 4 weeks ago

juliuspfadt commented 9 months ago

I exported a WhatsApp chat from my iphone backup, and when looking at the html, all times for a chat on a specific day are equal, when in truth they are not.

KnugiHK commented 9 months ago

Do you meant inside the chat, only messages on a specific day have the same time, but the rest of the messages in the chat have the correct times?

juliuspfadt commented 9 months ago

no, for a single chat, on each day all the messages have the same time. Different days do have different times though. so in total, none of the messages have the correct time, only the correct date. Although I assume that maybe always the first message of a day has the correct time

KnugiHK commented 7 months ago

Hi @juliuspfadt. I tried to fix the issue in f81f31d. However, as mentioned in another issue, I don't currently have access to the iOS WhatsApp. Therefore, I am not sure if the time exported is correct. You may want to give it a try in the dev branch.

LoSunny commented 7 months ago

Yes this indeed solve the issue. Also, is there a way for us to adjust the timezone? By default it seems to assume GMT, can we set hour own timezone or used the computer timezone as default?

KnugiHK commented 7 months ago

Yes this indeed solve the issue. Also, is there a way for us to adjust the timezone? By default it seems to assume GMT, can we set hour own timezone or used the computer timezone as default?

We can use pytz. But I want to keep the dependency minimal. Therefore, I implemented a simple offset option --time-offset in 9495691.

juliuspfadt commented 7 months ago

That fixes the issue yes. But I also found that the timestamps are not always in the correct order when extracted from the database. I had them printed in seconds, and it was evident why the messages would be not in chronological order. I added a few lines that would make sure they were in ascending order to the code, and that fixed the issue for me.

KnugiHK commented 7 months ago

That fixes the issue yes. But I also found that the timestamps are not always in the correct order when extracted from the database. I had them printed in seconds, and it was evident why the messages would be not in chronological order. I added a few lines that would make sure they were in ascending order to the code, and that fixed the issue for me.

Thanks for pointing out the problem. Does adding ORDER BY timestamp ASC (Android) and ORDER BY ZMESSAGEDATE ASC (iOS) to the SQL query solve the problem?

juliuspfadt commented 7 months ago

I only know about the iOS solution, and yes, that solves the problem. Feel free to close this

KnugiHK commented 7 months ago

I will leave this open until next release. Thanks a lot!

KnugiHK commented 4 weeks ago

Released in 0.10.0.