Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:date="http://exslt.org/dates-and-times"
- extension-element-prefix="date">
- <xsl:output method="html"/>
- <xsl:template match="/">
- <xsl:variable name="timestamp" select="1507387355"/>
- <xsl:variable name="datetime"
- select="date:add('1970-01-01T00:00:00+09:00',
- date:add-duration(date:duration($timestamp),'PT9H'))"/>
- <xsl:variable name="year" select="date:year($datetime)"/>
- <xsl:variable name="month" select="date:month-in-year($datetime)"/>
- <xsl:variable name="day" select="date:day-in-month($datetime)"/>
- <xsl:variable name="hour" select="date:hour-in-day($datetime)"/>
- <xsl:variable name="minute" select="date:minute-in-hour($datetime)"/>
- <xsl:variable name="second" select="date:second-in-minute($datetime)"/>
- <p><xsl:value-of select="$datetime"/></p>
- <p><xsl:value-of select="$year"/></p>
- <p><xsl:value-of select="$month"/></p>
- <p><xsl:value-of select="$day"/></p>
- <p><xsl:value-of select="$hour"/></p>
- <p><xsl:value-of select="$minute"/></p>
- <p><xsl:value-of select="$second"/></p>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement