$current-time parameter and Date field timestamp
This is an open discussion with 3 replies, filed under Troubleshooting.
Search
OK, scrap the above. I think all I'm after is the $now
parameter in the page params, to output the current time (e.g. 11:43
). I can use XSLT (with the help of EXSLT) to do the rest. I think.
Does this suffice nick?
I wrote an extension that outputs the current time as an event, that might be useful here too (see the extensions area).
Create an account or sign in to comment.
I'm looking to do some time manipulation, but I need second or minute-scale time references. The Date field outputs only the time and weekday attributes, but not the full Unix timestamp value.
Similarly there is no page level parameter to get the current time — we have
$today
,$this-year
,$this-month
and$this-day
but no$time-now
. Is there scope for adding this functionality to the core:$current-time
(e.g. 11:18) and$current-timestamp
(or renamed to be in line with the other params)I can do the former with a new Date field extension, but its functionality I can see people needing frequently for more complex sites, so in my opinion it should be in the core. Additionally I think it'd be very handy for a page to know the current server time (and full timestamp if possible).
My reasoning for this is that I'm writing XSLT to produce a "time ago" string for a date. For example "3 minutes ago" or "more than a week ago". Ideally this would just be a template, making use of the Date field timestamp and Page timestamp. However if this cannot be done, I'll need to go along the lines of extending the Date field.