Re: [Zope] Magic behavior of DateIndex in a ZCatalog
Python TimeStamp : DateTime.DateTime() DateIndex value : 1073242822 Metadata value : 2003/06/05 12:22:36.673 GMT+2
Yes? The internal DateIndex integer representation if a date is not the same as the string representation of a DateTime object either. They all mean exactly the same date, but the representation is not the same. Just as 04:00 GMT is the same as 06:00 CEST. Not the same representation, but they represent the same time.
a) Does that mean, that "1073242822" has nothing to do with the float representation of time.time() ? b) Does that mean, that "1073242822" is the same date + time as "2003/06/05 12:22:36.673 GMT+2" - it only has a different representation ? c) How can I convert the value "1073242822" to a "YYYY/MM/DD" value ? I tried:
time.ctime(1073242822) 'Sun Jan 04 20:00:22 2004'
but this does not seem to be right in comparison to the metadata value (2003/06/05 12:22:36.673 GMT+2)...
Is this DateTime index somehow useful (for searching?) in my catalog or should I throw 'em out ?
It's useful of you want to do searching on dates and times, yes.
Ah okay. Then, my next question is: how can I search for objects created on 2003/06/04 if I have to check agains values like "1073242822". Does the ZCatalog automatically transform input values like "2003/06/04" to these "10732..." values to search for objects ? thank you very much, lennart for clarification ! -nico ____________________________________________________________________________ Jetzt bei WEB.DE FreeMail anmelden = 1qm Regenwald schuetzen! Helfen Sie mit! Nutzen Sie den Serien-Testsieger. http://user.web.de/Regenwald
Nico Grubert wrote:
a) Does that mean, that "1073242822" has nothing to do with the float representation of time.time() ?
They are not the same, that is correct.
b) Does that mean, that "1073242822" is the same date + time as "2003/06/05 12:22:36.673 GMT+2" - it only has a different representation ?
Yes.
How can I convert the value "1073242822" to a "YYYY/MM/DD" value ?
You can't. If you want the value of an indexed object attribute you use meta data fiels in the catalog. Generally, the values used in the indexes are of no use except for searching.
Does the ZCatalog automatically transform input values like "2003/06/04" to these "10732..." values to search for objects ?
Yup.
participants (2)
-
Lennart Regebro -
Nico Grubert