Convert US date to Japanese

I am working on a multilingual site that needs a date to display in Japanese. I have a date in the USA 12-29-2010, which should be displayed in Japanese in 2010 年 12 月 29 日. I am using XSLT 3432. Could you tell me how I can do this.


I need to convert the English date to japanese from db, which has many different months / days / year and is updated regularly. This is just an example that I have provided.

I am using XSLT and can use Javascript in it

+3
source share
1 answer

This conversion is :

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output omit-xml-declaration="yes" indent="yes"/>

 <xsl:param name="pUSDate" select="'12-29-2010 '"/>

 <xsl:template match="/">
  <xsl:value-of select=
  "concat(substring($pUSDate,7,4),
          '年',
          substring($pUSDate,1,2),
          '月',
          substring($pUSDate,4,2),
          '日'
         )
  "/>
 </xsl:template>
</xsl:stylesheet>

, XML- ( ), , :

2010年12月29日
+1

Source: https://habr.com/ru/post/1782638/


All Articles