<!DOCTYPE HTML><html><!--https://bugzilla.mozilla.org/show_bug.cgi?id=603159--><head><title>Test for Bug 603159</title><scriptsrc="/tests/SimpleTest/SimpleTest.js"></script><linkrel="stylesheet"type="text/css"href="/tests/SimpleTest/test.css"/></head><body><atarget="_blank"href="https://bugzilla.mozilla.org/show_bug.cgi?id=603159">Mozilla Bug 603159</a><pid="display"></p><divid="content"style="display: none"></div><preid="test"><scripttype="application/javascript">/** Test for Bug 603159 **/varstyle='<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" '+'xmlns:date="http://exslt.org/dates-and-times" '+'version="1.0">'+'<xsl:output method="html"/>'+'<xsl:template match="/">'+'<xsl:value-of select="date:date-time()" /> '+'</xsl:template>'+'</xsl:stylesheet>';varstyleDoc=newDOMParser().parseFromString(style,"text/xml");vardata='<root/>';varoriginalDoc=newDOMParser().parseFromString(data,"text/xml");varprocessor=newXSLTProcessor();processor.importStylesheet(styleDoc);varfragment=processor.transformToFragment(originalDoc,document);varcontent=document.getElementById("content");content.appendChild(fragment);// use Gecko's Date.parse to parse, then compare the milliseconds since epochvarxslt_ms=Date.parse(content.innerHTML);varnow_ms=newDate().getTime();varaccepted_diff=30*60*1000;// 30 minutesvardiff=Math.abs(now_ms-xslt_ms);ok(diff<accepted_diff,"generated timestamp should be not more than "+accepted_diff+" ms before 'now', but the difference was: "+diff);content.innerHTML='';</script></pre></body></html>