简体   繁体   English

变更日期输出格式

[英]Change date output format

I'm using H2 db in my java application and i need to get the date from it. 我在Java应用程序中使用H2 db,我需要从中获取日期。 Everything is ok, but wneh i have 1-digit number of day or month, it gives me this format 2014-4-8. 一切都很好,但是我有1位数的天数或月数,它给了我这种格式2014-4-8。 Is it possile to get something like this (2014-04-08), with zeros without parsing it and formatting via the application? 是否有可能在不通过应用程序解析和格式化的情况下获得带有零的像这样的内容(2014-04-08)?

如果您在前端使用struts2,则以下标记可能对您有所帮助

<s:date name="somedate" format="EEE, MMM dd, yyyy " />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM