Deduct milliseconds from DateTime in xslt -
i have datetime in format: 2015-04-29t01:30:27.058z , time difference of 5000milliseconds. there xslt function can deduct time difference , produce output of datetime?
in xslt 2.0 or later (requires xslt 2.0 processor saxon 9 or xmlprime) can use arithmetic xs:datetime
, xs:daytimeduration
, instance
xs:datetime('2015-04-29t01:30:27.058z') + xs:daytimeduration('-pt0.058s')
computes new xs:datetime
2015-04-29t01:30:27z
.
the xml schema namespace assumed prefix xs
http://www.w3.org/2001/xmlschema
. see http://www.datypic.com/sc/xsd/t-xsd_daytimeduration.html on how daytimeduration
s can written.
so version of language suggestion make use of 2 data types , arithmetic operations provided instead of going milliseconds computations.
Comments
Post a Comment