Re: [xsl] trying to figure out date functions

Subject: Re: [xsl] trying to figure out date functions
From: Cas Tuyn <Cas.Tuyn@xxxxxxxx>
Date: Tue, 26 Apr 2005 11:38:51 +0200
Rick,

With 'substring' you can do nice things. I am telling my users to get used to the ISO numbering scheme, but you could very well do a xsl:choose/when converting 01 to Jan in the case of months.

Below you find my method of displaying only the history of changes within ~90 days before the last edit. Note that I add 12 months to the year and 31 days to the month to avoid negative differences in the month and days calculations, and later substract this value (12*30+31=391) again.

<xsl:if test="(	(	substring($lastedit,1,4) - substring(date,1,4)
) * 12 +
			substring($lastedit,6,2) + 12 -
substring(date,6,2)		) 	* 30 +
	substring($lastedit,9,2) + 31- substring(date,9,2)	-391
&lt;    90 ">


Cas




--
The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.

Current Thread