Search

Hey people.

Does anybody here know a quick and simple way to getting today's date formatted solely as milliseconds since 01 Jan 1970? I am currently using Javascript as a solution, however this is having issues with users who have Javascript disabled. grumble grumble grumble.

I know that you can get $today to display today's date, so is there a way that format-number( ) can be used to edit the behaviour of the string?

Any help would be muchios appreciatos! :D

Look at the options available in the EXSLT library, http://exslt.org/date/index.html

I have been playing around with trying to pull in the getTime function from Yahoo developers - I tried bringing it in as an external datasource but the caching makes that approach unfeasable.

I tried to use EXSLT but cannot find the correct syntax for milliseconds since epoch :(

Got around the problem with a slightly heavy handed approach...I made a custom data source which utilised php's microtime(); functionality. With a bit of string formatting I now have my desired result.

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