nmoya / whatsapp-parser

Parser to the What's App log file.
MIT License
47 stars 23 forks source link

Invalid date format? #3

Closed zbluhm closed 9 years ago

zbluhm commented 9 years ago

Hi!

I'm using your library for a project I'm working on and I've been getting the following error when I try to use it:

ValueError: time data '2014-12-25' does not match format '%y-%m-%d'

Seeing as the format should match, I'm wondering if you could offer a fix for this.

Thanks!

Edit: I'm not quite sure where it is getting that format from at all considering in the log file it is: "12/25/14 2:57:18 PM:"

zbluhm commented 9 years ago

So this fixed it:

in date.py I changed line 69 to: return time.strftime("%A", time.strptime(date, "%Y-%m-%d"))

instead of: return time.strftime("%A", time.strptime(date, "%y-%m-%d"))

nalbanders commented 9 years ago

Glad you figured it out. You just need the formats to match.

Curious, what project are you working on? Are you a developer? I am using this for a project of my own. On May 16, 2015 12:14 PM, "zbluhm" notifications@github.com wrote:

So this fixed it:

in date.py I changed line 69 to: return time.strftime("%A", time.strptime(date, "%Y-%m-%d"))

instead of: return time.strftime("%A", time.strptime(date, "%y-%m-%d"))

— Reply to this email directly or view it on GitHub https://github.com/nmoya/whatsapp-parser/issues/3#issuecomment-102646009 .

nmoya commented 9 years ago

Hey @zbluhm

Thank you for showing the fix. I will fix this in my next commit.