WhatsApp-Chat-Exporter icon indicating copy to clipboard operation
WhatsApp-Chat-Exporter copied to clipboard

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

Open juliuspfadt opened this issue 1 year ago • 9 comments

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.

juliuspfadt avatar Oct 02 '23 13:10 juliuspfadt

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?

KnugiHK avatar Oct 02 '23 16:10 KnugiHK

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

juliuspfadt avatar Oct 03 '23 08:10 juliuspfadt

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.

KnugiHK avatar Dec 03 '23 06:12 KnugiHK

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?

LoSunny avatar Dec 03 '23 11:12 LoSunny

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.

KnugiHK avatar Dec 03 '23 12:12 KnugiHK

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.

juliuspfadt avatar Dec 03 '23 16:12 juliuspfadt

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?

KnugiHK avatar Dec 07 '23 14:12 KnugiHK

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

juliuspfadt avatar Dec 07 '23 15:12 juliuspfadt

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

KnugiHK avatar Dec 07 '23 15:12 KnugiHK

Released in 0.10.0.

KnugiHK avatar Jun 08 '24 11:06 KnugiHK