prabhakar267/WA-Reader

Timestamps not parsed

Closed this issue · 4 comments

Hello, I have just discovered your wonderful tool. It is perfect and exactly what I needed, so thank you. There is just one problem I am encountering. The timestamps are showing up as a sequence of digits. Your example on your page here https://devpost.com/software/whatsapp-reader shows the timestamp in the correct format.

I have attached an image of what i am seeing, (I have scored out the actual text)

I would just like to know if this is as intended, or if there is something wrong with my exported whatsapp files, or if this is a bug. Is there any way I can view the chat with the timestamps?
whatsappchat

edsac commented

Hi... was seeing the same. Digging in the code, in parse/inc/function.inc.php, function getConvertedTimestamp($chat_string) returns this timestamp in the form you are seeing:

return strtotime($timestamp);

guessing that this is expected to be rendered into human-readable form elsewhere, however I had success simply changing this to return the format I wanted:

// return strtotime($timestamp);
return gmdate('Y-m-d H:i', strtotime($timestamp));

@edsac Can you open a PR for the same?

I think this is the same reasons why it is not working on chat backup taken on Windows phone.

@seashehl It should work now properly. Please feel free to reopen this issue or open a new one if you face any problem.