View Single Post
Old 05-14-2012, 11:24 PM   #402
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@kiwidude: You want to use parse_only_date() from utils/date.py. Naively creating a utc datetime from a date will cause the month/year to be wrong in some timezones. Note that this function is a relatively recent addition to calibre, so you'd best re-implement it in your plugin for backwards compatibility.

Last edited by kovidgoyal; 05-15-2012 at 06:03 AM.
kovidgoyal is offline   Reply With Quote