Quote:
Originally Posted by chaley
I tried it using an action that stores the book_id to a column. It worked very nicely.  I will try the book_vars variant later.
|
Good to know.
Quote:
Originally Posted by chaley
Comparing date strings:
Code:
if format_date($last_modified, 'iso') > format_date($#mydate, 'iso') then
|
Never thought about comparing iso strings. Nice trick.
Quote:
Originally Posted by chaley
However, I think a good solution is to add the 'timestamp' format to format_date, returning a floating point timestamp. I would also change format_date() to allow a timestamp as the first argument (the "date") permitting conversion of timestamps to date strings. This would do what you need and also facilitate arithmetic on dates. Example:
Code:
program:
t = format_date($last_modified, 'timestamp');
strcat(t, ' -- ', format_date(t, 'yyyy MMM ddd hh:MM:ss'))
Result: 1616695611.0 -- 2021 Mar Thu 18:03:51
One possible problem with both implementations: the dates lose their timezone. I don't see that as a big deal.
|
Sounds like a perfect solution. The timezone thing is not important IMO. I will remove the to_timestamp() from the next version as yours is much better.