Dates - Eonic/ProteanCMS GitHub Wiki
This section is responsible for extracting and formatting date information from server variables. It pulls the current date and breaks it down into the year, month, and day, which can be useful for displaying or processing date-related information.
Description: This variable captures the current date from the server variables. It retrieves the Date
value, which represents the current date as reported by the server.
<xsl:variable name="today" select="/Page/Request/ServerVariables/Item[@name='Date']/node()"/>
Description: This variable extracts the year from the today
variable. It uses the substring()
function to retrieve the first four characters, which represent the year.
<xsl:variable name="currentYear" select="substring($today,1,4)"/>
Description: This variable extracts the month from the today
variable. It uses the substring()
function to retrieve characters 6 and 7, which represent the month.
<xsl:variable name="currentMonth" select="substring($today,6,2)"/>
Description: This variable extracts the day from the today
variable. It uses the substring()
function to retrieve characters 9 and 10, which represent the day of the month.
<xsl:variable name="currentDay" select="substring($today,9,2)"/>