Bug #3596

current-date and current-dateTime does not give the instant date/time stamp

Added by O'Neil Delpratt about 1 year ago. Updated 10 months ago.

Start date:
Due date:
% Done:


Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Contact person:
Additional contact persons:


The current-date and current-dateTime does not give the instant date/time stamp when called during an 'interactive' XSLT event. This is noticeable if the browser is not refreshed overnight.

As a workaround I guess I could force a call to the transform function or call out to JavaScript.

It would be desirable to have implemented in Saxon-JS the extension function saxon:timestamp.


#2 Updated by Michael Kay about 1 year ago

I think it would probably make sense for current-dateTime() to be updated whenever an ixsl:schedule-action occurs or when an event-driven template rule is activated. If we went this way we would have to make sure that the optimizer is aware that current-dateTime() and friends are no longer pure functions, and mustn't be promoted to global variables. If that proves problematic, then using saxon:timestamp() for the purpose might be an alternative way forward.

Note also that implicit-timezone() can also potentially change while a stylesheet is waiting for the next user event.

#3 Updated by Debbie Lockett about 1 year ago

Function saxon:timestamp() implemented (1.0 and trunk branches).

#4 Updated by Debbie Lockett 12 months ago

JS unit test saxonExt/timestamp01 added (note saxon:timestamp() available from 9.8).

To do: add information to documentation.

#5 Updated by Debbie Lockett 11 months ago

  • Status changed from New to Resolved
  • Fix Committed on JS Branch 1.0, Trunk added

Documentation updated: added subsection about available Saxon extensions in Conformance section (conformance/saxon-extensions).

#6 Updated by Debbie Lockett 10 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.1.0

Bug fix applied in the Saxon-JS 1.1.0 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page