Skip to content

Commit

Permalink
Fixes #70 by correctly adjusting the time from system value to UTC ti…
Browse files Browse the repository at this point in the history
…me zone
  • Loading branch information
contrext committed Jun 3, 2016
1 parent 1f824c4 commit 88545d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xsl/map2epubOpfImpl.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,11 @@
<xsl:param name="effectiveCoverGraphicUri" select="''" as="xs:string" tunnel="yes"/>

<!-- Context node is the map -->
<!-- NOTE: the spec seems to require the "Z" (indicating a UTC time) but I don't
know of format-dateTime() is actually timezone aware, so this
construction may not be 100% correct.
-->
<xsl:variable name="utcTime" as="xs:dateTime"
select="adjust-dateTime-to-timezone(current-dateTime(), xs:dayTimeDuration('-PT0H'))"
/>
<xsl:variable name="formatted-time" as="xs:string"
select="format-dateTime(current-dateTime(), '[Y]-[M,2]-[D,2]T[h,2]:[m,2]:[s,2]Z')"
select="format-dateTime($utcTime, '[Y]-[M,2]-[D,2]T[h,2]:[m,2]:[s,2]Z')"
/>
<!-- NOTE: For EPUB3, the <meta> element has different attributes from
EPUB2. Instead of @name and @value, it uses @property to specify
Expand Down

0 comments on commit 88545d3

Please sign in to comment.