Skip to content

Instantly share code, notes, and snippets.

@edegula
Created August 21, 2019 05:38
Show Gist options
  • Save edegula/6b399f84f066b026a67b29018d8e0bdf to your computer and use it in GitHub Desktop.
Save edegula/6b399f84f066b026a67b29018d8e0bdf to your computer and use it in GitHub Desktop.
<!-- input.xml -->
<!-- <date>2017-02-05T10:40:00+04:00</date> -->
<!-- convert_local_datetime_to_utc.xsl -->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:saxon="http://saxon.sf.net/"
exclude-result-prefixes="xs saxon">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="date">
<xsl:copy>
<xsl:value-of select="adjust-dateTime-to-timezone(., xs:dayTimeDuration('PT0H'))"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment