Search

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:

  • output the timestamp for the Date field
  • add two additional page parameters: $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.

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.

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details