显示格式:年-月-日

  方法:1.加包import java.sql.Date; 而非import java.util.Date; //显示格式为:年-月-日··· 时:分:秒

     2.使用DateFormatter转换  :<s:date name="createDate" format="yyyy-MM-dd" />注意MM一定要大写,不然会不起作用或者时间显示不正常,因为在Java中,M(Mouth)表示“月”,而m(minute)表示“分”。

     3.字符串截取:String createDate=updatetime.get(0).toSting().substring(0,10);

 

相关文章:

  • 2021-08-03
  • 2021-08-30
  • 2021-12-05
  • 2021-11-12
  • 2022-12-23
  • 2021-12-06
  • 2021-10-31
  • 2022-01-08
猜你喜欢
  • 2021-07-14
  • 2021-12-10
  • 2022-12-23
  • 2021-08-20
  • 2022-01-05
  • 2021-11-15
  • 2021-11-12
相关资源
相似解决方案