[pmwiki-users] Q: Time comparing

Patrick R. Michaud pmichaud at pobox.com
Tue Jul 31 15:16:27 CDT 2007


On Tue, Jul 31, 2007 at 12:48:33PM +0200, Jiri Hladůvka / OBUTEX wrote:
> Hi list,
> I have a  page text variable "Atime" with time value formated as 
> YYYYMMDD-HH:MM:SS
> I need to set
> - red text color if  "Atime" is between {(ftime  "now")}  and {(ftime  
> "now -1 hour")}
> - yellow text color if  "Atime" is between {(ftime  "now")}  and 
> {(ftime  "now -12 hours")}
> - black (default) text color for each other case
> 
> I played in my sandbox with various forms of (:if date ... but I could 
> not make it work:
> (:if date {(ftime "{$:Atime}" )} {(ftime  "now -1 hour")}..{(ftime  
> "now")}:)
> this time is within 1 hour
> (:ifend:)
> 
> Would someone like to show me how to make the condition?
> I can change the time format in the Atime if necessary.

I don't think PmWiki's time markups understand HH:MM:SS formats
yet.  I'll add it for the next release.

Pm



More information about the pmwiki-users mailing list