Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-15-2021, 04:33 AM   #1
maraskan_user
Member
maraskan_user began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2020
Location: Germany
Device: Boox Nova 3, Galaxy Tab S6, Samsung M21
How to prevent pubdate reformating when sending to device?

I have an issue with pubdates getting changed in unwanted ways on sending to device. (I am aware that the formating itself can be changed by the setting "Format dates as:" in the "Sending books to devices" category, but there seems no way to set it to actually not reformat dates at all.)

Say I have an epub titled "BookTitle" with pubdate "1981-01-01".
"Format dates as" is set to "%Y-%m-%d".

The book then will end up on the device as
"(1980-12-31) BookTitle.epub"

Notice that the date has shifted, probably because of some timezone reasons.

The weird part is, when I sent to device yesterday evening it used the date 1981-01-01, while when resending today it used 1980-12-31 which led to unwanted duplicates on the device. I haven't figured out yet, at what time in the day sending to device creates the 1981 filename vs. the 1980 one.

I tried circumventing Calibre reformating the date by using a custom column {#customname} which is defined as "({pubdate}) {title}".
The custom column in Calibre correctly shows "(1980-12-31) BookTitle".
My hope was that Calibre would treat this as a blackbox string it would not mess with while sending to device, since it couldn't even know that the contained date wasn't part of the book's title or something.

No luck though, the filename on export was still changed to "(1980-12-31) BookTitle.epub"

So my question is: Is there any way of stopping Calibre messing with the pubdate in filenames on export?
maraskan_user is offline   Reply With Quote
Old 04-24-2021, 01:02 AM   #2
chinax
Member
chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.chinax composes epic poetry in binary.
 
Posts: 24
Karma: 90156
Join Date: Jul 2017
Device: Nook Glowlight, Sony DPT-CP1
Huh. This is specfic to New Years' dates (Dec 31-Jan 1), correct?
chinax is offline   Reply With Quote
Advert
Old 04-24-2021, 01:33 AM   #3
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Based on my own prior issues with datetime columns, I'd try formatting the raw_field instead of using pubdate directly. Something like {format_date(raw_field('pubdate'), 'yyyy-MM-dd'} I think.

Last edited by ownedbycats; 04-24-2021 at 01:41 AM.
ownedbycats is offline   Reply With Quote
Old 04-24-2021, 07:58 AM   #4
maraskan_user
Member
maraskan_user began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2020
Location: Germany
Device: Boox Nova 3, Galaxy Tab S6, Samsung M21
Quote:
Originally Posted by chinax View Post
Huh. This is specfic to New Years' dates (Dec 31-Jan 1), correct?
Yes, this is the specific case I noticed it with, since I ended up getting the wrong year.


Quote:
Originally Posted by ownedbycats View Post
Based on my own prior issues with datetime columns, I'd try formatting the raw_field instead of using pubdate directly. Something like {format_date(raw_field('pubdate'), 'yyyy-MM-dd'} I think.
I got it working with this {:'format_date(raw_field('pubdate'),'yyyy')'} and the year entries looks promising so far. Thank you very much!
maraskan_user is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to prevent calibre from automatically sending news to my device? jedediah Calibre 4 04-12-2022 07:50 PM
How to prevent sending news to one of my devices? yurkennis Library Management 1 01-20-2018 09:54 PM
How to prevent cover being replaced when sending book to device? GeoffR Library Management 5 04-11-2015 05:07 AM
How do i prevent Calibre from converting when sending books to a device? DMcCunney Library Management 7 06-06-2014 04:56 PM
Prevent Calibre from sending pub date? PapaJohn Devices 4 04-06-2011 03:14 AM


All times are GMT -4. The time now is 10:58 PM.


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