11-12-2014, 08:03 PM | #1 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2014
Device: Android
|
update date in populate_article_metadata?
Why does this work:
Code:
def populate_article_metadata(self, article, soup, first): article.title='Hello' Code:
def populate_article_metadata(self, article, soup, first): article.date = '1/25/2014' |
11-12-2014, 09:35 PM | #2 |
creator of calibre
Posts: 43,828
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You dont pass in a string date, you pass in a parsed time struct.
Use import time article.date = time.strftime(...) EDIT: And IIRC to change the actual displayed date, you set formatted_date, not date (date is used internally to expire old articles and so on). And formatted date accepts a unicode string. Last edited by kovidgoyal; 11-12-2014 at 09:41 PM. |
Advert | |
|
11-12-2014, 10:14 PM | #3 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2014
Device: Android
|
Ah, thanks -- that will help a lot.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update Read date from companion to Calibre | Wirrel | Calibre Companion | 1 | 09-08-2013 08:25 PM |
How to update metadata information from excel (Publication Date,Tags) | mahaveer | Calibre | 3 | 09-26-2011 12:55 PM |
Help for populate_article_metadata | ajmoraal | Recipes | 10 | 11-16-2010 04:24 PM |
Bulk Changing Published Date To Date | hmf | Calibre | 4 | 10-19-2010 10:19 PM |
Up-to-date candy teacher (date being 1921) | kacir | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 06-16-2010 04:18 PM |