0

I need to create a variable that stores the current date but I only need the four digit year. Here is my code I don't understand why it doesn't work. note: Ive already tried using number(substring(current-date())) and it doesn't work either, I tried different methods and I can't get it to work.

<xsl:variable name="currentYear" select="year-from-dateTime(current-dayTime())"/>

<xsl:value-of select="$currentYear - year"/>

sansievar
  • 17
  • 5

1 Answers1

0

XSLT does not have a current-dayTime() function.

If your processor supports XSLT 2.0 or higher, you can use year-from-dateTime(current-dateTime()).

y.arazim
  • 866
  • 2
  • 10