0

<div th:text="${#dates.format(204587433443L)}"></div

June 25, 1976 5:50:33 PM EDT用英语,和

25 juin 1976 17:50:33 EDT法语

我只想要日、月和年,同时仍然保持语言特定的格式,如下所示:

June 25, 1976对于英语,和

25 juin 1976法语。

我已经尝试过<div th:text="${#dates.format(204587433443L, 'MMMM dd, yyyy')}"></div,但结果juin 25, 1976不是我想要的。


4

1 回答 1

0

您可以为每个 Culture 使用切换条件:

<div th:switch="${#locale}"> 
<p th:case="'en-US'">
   // us colture format MMMM dd YYYY
<p th:case="'fr-FR '">
  // us colture format dd MMMM YYYY
于 2019-11-29T19:45:33.340 回答