Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-08-2014, 07:58 PM   #1
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,635
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Question Dates - Appear held to be inconsistent

This has long puzzled me, I was reminded of it by this ==>> How to format pubdate...

The attached screen shot overlays a csv catalogue on the calibre book list for a single book.

The Published and My Published columns are both formatted as 'yyyy MM dd', they were entered into the book list within a second of two of one another, both were entered as '2015 01 01' (without use of the calendar gadget).

So my questions are
  1. Why do they have different internal representations.
  2. And what does my local offset from UTC time have to do with the published date - currently +11, a week ago it was +10. Sydney's small beer when it comes to book publishing
BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	181
Size:	55.0 KB
ID:	129400  
BetterRed is offline   Reply With Quote
Old 10-08-2014, 10:25 PM   #2
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: 45,200
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
dates are always stored as full timestamps internally, regardless of their display representation. As for the different formats, that is likely an artifact of the catalog creation code. Dates are always stored in UTC internally, although as long as full timezone offset information is present, it does not matter.
kovidgoyal is offline   Reply With Quote
Advert
Old 10-09-2014, 02:36 AM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,635
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kovidgoyal View Post
dates are always stored as full timestamps internally, regardless of their display representation. As for the different formats, that is likely an artifact of the catalog creation code. Dates are always stored in UTC internally, although as long as full timezone offset information is present, it does not matter.
The different 'formats' for 2015-01-01 are also in the metadata.opf, and they're what I see in metadata.db with SQLite Browser, so I have to question that the difference is an 'artefact of catalogue creation'.

It seems to me that the internal value for timestamp (Date) and pubdate (Published) are carried as entered, along with the locale offset from UTC. However, values for dates that I define are normalised to UTC time by applying the offset. Surely all dates should be subject to the same rules.

And it does matter, in order to get something sensible into a spreadsheet I need to have a template derived custom column the converts the date to a string. To do anything with dates in a spreadsheet requires a string 'format' that the spreadsheet software can cope with - eg to calculate the elapsed period between the publication of book A and book B.

Unravelling values like '2014-12-31T23:15:49+00:00' and 2012-07-23T00:00:00+10:00 in excel to get back to the values I entered - '2015 01 01' and 2012-07-23 - is vexing.

As things stand, any dates that I want in a csv require two columns, one that I can edit in calibre, and another that I can dump into a csv.

If I could apply a formatting template to columns when the csv catalogue is written - as I can for EPUB and MOBI catalogues - then I wouldn't have to carry the 'derived columns' in the database. I appreciate they're calculated as needed, but it irritates me that I have to carry the complexity of additional columns to put something in a CSV catalogue that I would not need for an EPUB or MOBI catalogue.

BR
BetterRed is offline   Reply With Quote
Old 10-09-2014, 02:54 AM   #4
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: 45,200
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The date 2014-12-31T23:15:49+00:00 is in the international standard for date time string, ISO 8601

If your spreadsheet program cannot parse that, you need to get yourself a new spreadsheet program.
kovidgoyal is offline   Reply With Quote
Old 10-09-2014, 07:44 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,635
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Yes Excel 2007 can parse it, if I tell it how, as in Parsing an ISO8601 date/time (including TimeZone) in Excel

I have too much investment in Excel to consider looking for a new spreadsheet program.

As someone commented in the above link - "(: this should be built in", but the fact is that's it's not. Maybe it is in 2010 or 2013 versions of Excel.

BR
BetterRed is offline   Reply With Quote
Advert
Old 10-09-2014, 08:43 PM   #6
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: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I believe you can just open a new column in any Spreadsheet:

Insert a Substring(cell,4) formula referencing the imported ones field and then copy 'down' to all remaining cells (most adjust the cell references)

I don't know how to do it in OO, but Quattro Pro had a command to change formula cell contents to the calculated value


You have options once you learn your available tools
theducks is offline   Reply With Quote
Old 10-09-2014, 09:56 PM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,635
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@theducks - Cut & paste won't to a conversion - there is no ISO Date format in Excel 2007, nor I suspect was there such a thing in Quattro, or the grandfather of all such things - Visicalc.

It is crazy that it's easier to pivot a table, or do an FFT in Excel than it is to deal with ISO dates - but that's the way it is I'm afraid.

If I use a general format eg 'yyyy-mm-dd' against the string 2014-12-31T23:15:49+00:00 it wont be reformatted, if I substr the 1st 10 chars I get 2014-12-31 as a date (value rather than a string) - but the value I entered into calibre was 2015-01-01!

I still don't understand why pubdate and #mydate are held inconsistently when I enter the same value.

I tried defining all the dates as 'iso' to see if it would the overcome the inconsistency . But when I do that I can't even enter a full date; month and year is all I can get, see attachment. And the peculiar value in My Published, that was what I got when I clicked Set "My Published' to today - I'm guessing this is a cutie five glitch.

I'll retain the template derived columns, they do work and I can use Excel's formatting features to get dates on which I can do arithmetic.

BR
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	125
Size:	56.3 KB
ID:	129448  

Last edited by BetterRed; 10-09-2014 at 10:02 PM.
BetterRed is offline   Reply With Quote
Old 10-09-2014, 11:06 PM   #8
AnotherCat
....
AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.
 
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
Quote:
Originally Posted by BetterRed View Post
Yes Excel 2007 can parse it, if I tell it how, as in Parsing an ISO8601 date/time (including TimeZone) in Excel
I assume that you are not doing it that way though as it can be done with a simple formula in a cell?

Mentioning it just in case.
AnotherCat is offline   Reply With Quote
Old 10-10-2014, 03:18 AM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,635
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@AnotherCat - the CSV catalogues are ad-hoc and ephemeral - IMO a VBA macro would be more easily reused than a cell formula. BTW the results of my inter-book arithmetic ends up in the calibre database via the Import List PI

But the custom column templates I have are trivial, and I don't discern any effect on performance on a 50K book library. So cell formulae and/or VBA macros are not needed, simply format the calibre created date-string column to an Excel date-value and watch them shift to the right

I was wishful thinking that rather than applying the formatting template in custom columns, I could apply it when I create the CSV catalogue, as I could if I were creating an EPUB Catalogue.

Leaving things as is the best solution - as I already said - it works.

BR

Last edited by BetterRed; 10-10-2014 at 04:56 AM.
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo page number inconsistent. RogerioFM Kobo Reader 16 03-19-2014 01:00 PM
Inconsistent Spacing N00ter ePub 26 04-15-2012 09:51 AM
Inconsistent Display of Cover Motto Kobo Reader 2 03-22-2011 11:36 PM
Inconsistent Metadata windybt Calibre 8 10-10-2010 12:31 PM
Calibre + NYT download = inconsistent? maxbookworm Calibre 36 06-28-2010 07:30 AM


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


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