View Single Post
Old 05-14-2012, 05:28 PM   #401
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@cedc7731 - I don't see this behaviour, it all works as expected with identical dates for me?

The only thing I can think of is you have some sort of timezone issue going on with your machine/location that I am not hitting. Perhaps Kovid/chaley may spot this and comment - my code just grabs the date text from the goodreads xml, turns it into the appropriate integers (that can't really go wrong unless goodreads is giving the wrong data back to you) and then does this to turn it into a datetime object:
Code:
        from calibre.utils.date import utc_tz
        return datetime.datetime(year, month, day, tzinfo=utc_tz)
That result value will then be applied to the database custom column (in the new_value variable) using:
Code:
        self.db.set_custom(calibre_id, new_value, label=label, commit=False)
kiwidude is offline   Reply With Quote