02-17-2024, 02:43 PM | #1 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
Pubdate in export title minus one
Hello!
I have a huge library of daily newspapers for Kindle in .mobi format. (Actually it is .pobi which I have simply renamed to .mobi to make them readable for Calibre.) Now I want to convert them all to .ePub and to export them. After fiddling a bit with the export options the exported files look okay. But to my surprise the naming of the exported .ePub files is causing trouble: I use the date format: %d.%m.%Y And the file name should be: {title} (Kindle-Ausgabe) {pubdate} "Kindle-Ausgabe" means "Kindle issue" in German, by the way. But I don't get the publishing date that is displayed in the library's publishing date column but the publishing date minus one day when I export them. Having the proper publishing date is crucial for a daily newspaper, of course. Is this a bug? Am I doing something wrong? Any help is appreciated! |
02-17-2024, 03:20 PM | #2 |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
this might be a time zone issue.
A difference on where it was published and your system |
02-17-2024, 05:00 PM | #3 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
The newspapers were published in the same time zone. Unless it does matter that Amazon is located in the US.
But why could that be a problem at all? Do the e-books have timezone related timestamps or are their publish dates simple strings containing a date? It should be like that, because a newspaper published on July 10th in California is still a newspaper published on July 10th when read in Australia. And the publish date is something set in the generating of the .pobi file, it is not the creation date of the file nor the download date. The former would be the day before the publish date and the latter would be sometimes later. Last edited by Archibald Yates; 02-18-2024 at 03:09 AM. |
02-17-2024, 07:13 PM | #4 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
I have found this from quite a while ago.
So if it is actually a timezone problem, would it be possible to create a custom column with has pubdate + 1? And to use it in export instead of the original pubdate? And if so, how? |
02-17-2024, 10:34 PM | #5 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can use the calibre template language for this:
https://manual.calibre-ebook.com/template_lang.html |
02-18-2024, 03:12 AM | #6 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
Hello Kovid, thank you for your reply. And an even bigger thank you for the great software in general!
I have looked at the template language. But how could I provide a simple {pubdate+1} date in the name of the exported ePubs? I am not sure about the code I would have to use—date_arithmetic({pubdate}, 1d)?—and even more so where to put it. And if it is all about the metadata's time stamp that includes the time zone why is Calibre handling this time stamp differently in the library window than in export? Last edited by Archibald Yates; 02-18-2024 at 03:15 AM. |
02-18-2024, 03:28 AM | #7 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Because in the library window it is shown in local timezone in export the UTC timezone is exported
|
02-18-2024, 04:11 AM | #8 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
Okay. But how do I get the proper (local) date into the file name? What are the specific steps?
|
02-18-2024, 04:25 AM | #9 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
change the template from {pubdate} to whatever you need using date_arithmetic
|
02-18-2024, 04:36 AM | #10 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
But where do I put date_arithmetic?
It does not work here: |
02-18-2024, 04:39 AM | #11 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Code:
{date_arithmetic(pubdate, whatever)} |
02-18-2024, 04:48 AM | #12 |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
Result:
PHP Code:
Last edited by Archibald Yates; 02-18-2024 at 04:54 AM. |
02-18-2024, 09:52 AM | #13 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Look at the template language documentation for Single Function Mode, which is what you are trying to use. You will see that it requires the field to be operated, a colon, and the function to apply. As in:
Code:
{pubdate:date_arithmetic(1d)} |
02-18-2024, 01:35 PM | #14 | |
Member
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
|
Quote:
Luckily, I had tested the new export naming formula on both my newest and my oldest newspaper file with more than a decade between them. So I found out that, in order to maintain the suspense, Amazon seems to have used a different time zone, identical to mine, until some day in the early 2010s. I am searching for the exact date of the switch because before that I will simply need {pubdate}. Sigh. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapter Title for Highlight Export | Thirteen OBD | Viewer | 12 | 02-01-2022 06:00 PM |
Export Title with 'The' at the end | tranquilo2 | Library Management | 2 | 07-26-2020 11:45 AM |
how to export books with same title? | Eidfjord | Library Management | 9 | 01-24-2017 08:18 AM |
export .mobi with specific title output? | akita | Library Management | 9 | 07-16-2015 12:27 AM |
Search/Replace from Title Field to Pubdate | TMSxMR | Library Management | 5 | 08-06-2012 03:40 AM |