Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2024, 02:43 PM   #1
Archibald Yates
Member
Archibald Yates began at the beginning.
 
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!
Archibald Yates is offline   Reply With Quote
Old 02-17-2024, 03:20 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,754
Karma: 54401244
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
theducks is offline   Reply With Quote
Advert
Old 02-17-2024, 05:00 PM   #3
Archibald Yates
Member
Archibald Yates began at the beginning.
 
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.
Archibald Yates is offline   Reply With Quote
Old 02-17-2024, 07:13 PM   #4
Archibald Yates
Member
Archibald Yates began at the beginning.
 
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?
Archibald Yates is offline   Reply With Quote
Old 02-17-2024, 10:34 PM   #5
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,826
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
kovidgoyal is offline   Reply With Quote
Advert
Old 02-18-2024, 03:12 AM   #6
Archibald Yates
Member
Archibald Yates began at the beginning.
 
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.
Archibald Yates is offline   Reply With Quote
Old 02-18-2024, 03:28 AM   #7
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,826
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
kovidgoyal is offline   Reply With Quote
Old 02-18-2024, 04:11 AM   #8
Archibald Yates
Member
Archibald Yates began at the beginning.
 
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?
Archibald Yates is offline   Reply With Quote
Old 02-18-2024, 04:25 AM   #9
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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
change the template from {pubdate} to whatever you need using date_arithmetic
kovidgoyal is offline   Reply With Quote
Old 02-18-2024, 04:36 AM   #10
Archibald Yates
Member
Archibald Yates began at the beginning.
 
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:
Attached Thumbnails
Click image for larger version

Name:	Bildschirmfoto 2024-02-18 um 10.33.52.png
Views:	20
Size:	139.8 KB
ID:	206441  
Archibald Yates is offline   Reply With Quote
Old 02-18-2024, 04:39 AM   #11
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,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
{date_arithmetic(pubdate, whatever)}
kovidgoyal is offline   Reply With Quote
Old 02-18-2024, 04:48 AM   #12
Archibald Yates
Member
Archibald Yates began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
Result:
PHP Code:
EXCEPTIONWertUnbekanntes Feld date_arithmetic(pubdate1d
"Wert" is value and "Unbekanntes Feld" is unknown field.
Attached Thumbnails
Click image for larger version

Name:	Bildschirmfoto 2024-02-18 um 10.54.17.png
Views:	28
Size:	164.4 KB
ID:	206442  

Last edited by Archibald Yates; 02-18-2024 at 04:54 AM.
Archibald Yates is offline   Reply With Quote
Old 02-18-2024, 09:52 AM   #13
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,728
Karma: 6690881
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)}
You might want to add the "format" argument the date_arithmetic() function. The format string is described in the date_format() function documentation.
chaley is offline   Reply With Quote
Old 02-18-2024, 01:35 PM   #14
Archibald Yates
Member
Archibald Yates began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jan 2012
Device: Kindle Paperwhite 11th. gen., Kindle Oasis 8th. gen., Kindle Touch
Quote:
Originally Posted by chaley View Post
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)}
You might want to add the "format" argument the date_arithmetic() function. The format string is described in the date_format() function documentation.
That did help, thank you.

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.
Archibald Yates is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 06:53 AM.


MobileRead.com is a privately owned, operated and funded community.