如何使用 Struts2 以 24 小时格式显示时间
How to display the time in 24-hour format using Struts2
我正在使用 Struts2 并希望以 24 小时格式显示时间,但它以 12 小时格式显示。
<sx:datetimepicker name="LoginTime"
type="time"
displayFormat = "HH:mm"
label="Login Time(HH:MM 24hours format)" />
格式"HH"
在Java中使用24小时,"hh"
用于12 小时。
从sx:
开始,Struts2 Dojo标签常用的前缀,你最好将其替换为"sj:"
和Struts2 jQuery plugin. It is using its own format for displaying the value. The DatePicker widget displayFormat
attribute should be used to define the format of the date. If it doesn't fit the required format you have also an option to format the value in topic. To display a date and time you need a timepicker addon。
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head locale="de" jquerytheme="lightness"/>
</head>
<body>
<s:form id="form" theme="xhtml">
<sj:datetimepicker name="LoginTime" timepicker="true" timepickerOnly="true" timepickerFormat="hh:mm" label="Login Time(HH:MM 24hours format)"/>
</s:form>
</body>
</html>
我正在使用 Struts2 并希望以 24 小时格式显示时间,但它以 12 小时格式显示。
<sx:datetimepicker name="LoginTime"
type="time"
displayFormat = "HH:mm"
label="Login Time(HH:MM 24hours format)" />
格式"HH"
在Java中使用24小时,"hh"
用于12 小时。
从sx:
开始,Struts2 Dojo标签常用的前缀,你最好将其替换为"sj:"
和Struts2 jQuery plugin. It is using its own format for displaying the value. The DatePicker widget displayFormat
attribute should be used to define the format of the date. If it doesn't fit the required format you have also an option to format the value in topic. To display a date and time you need a timepicker addon。
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head locale="de" jquerytheme="lightness"/>
</head>
<body>
<s:form id="form" theme="xhtml">
<sj:datetimepicker name="LoginTime" timepicker="true" timepickerOnly="true" timepickerFormat="hh:mm" label="Login Time(HH:MM 24hours format)"/>
</s:form>
</body>
</html>