View Single Post
Old 10-03-2021, 04:22 PM   #167
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: 12,461
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Why does program: raw_field('date') return "None" while field('date') works?

$date and $$date get the same result.

EDIT: It happens even if I set gui_pubdate_display_format back to default.

ANOTHER EDIT: For reference, I'm using search & replace to copy to another datetime field.
It happens because 'date' is an alias for the (historically) real field 'timestamp'. The field() function does the translation. The raw_field() function doesn't.

Workaround: use 'timestamp' instead of 'date'.

EDIT: Also & FWIW: raw_field for dates returns 0101-01-01 00:00:00+00:00 for the unknown date because that is what is stored in the db. Up to you to know what to do with it.

Last edited by chaley; 10-03-2021 at 04:25 PM.
chaley is offline   Reply With Quote