- This topic has 9 replies, 4 voices, and was last updated 11 years, 5 months ago by
support-swapna.
-
AuthorPosts
-
giann_mgaMemberHow can i change input date format to ‘dd/mm/yyyy’ in jsp pages?
July 13, 2011 at 10:49 am #318201
support-joyMembergiann_mga,
Try the following –
DateFormat dateFormat= new SimpleDateFormat(“dd/MM/yyyy HH:mm:ss”);
Date date= new Date();
String dateString= dateFormat.format(date);July 13, 2011 at 1:30 pm #318207
giann_mgaMemberWhere can i put that sequence? I have the instructions below in my jsp page:
<input id=”associado_datnas” name=”datnas” type=”text” value=”<fmt:formatDate value=”${associado.datnas.time}” pattern=”yyyy-MM-dd”/>” dojoType=”dijit.form.DateTextBox” constraints=”{datePattern:'<fmt:message key=”date.format”/>’}” trim=”true” promptMessage=”<fmt:message key=”date.format” />” invalidMessage=”<fmt:message key=”date.format.invalid” /> <fmt:message key=”date.format” />.” style=”width:300px;” />
July 14, 2011 at 4:34 am #318218
support-joyMembergiann_mga,
<fmt:formatDate value=”${associado.datnas.time}” pattern=”yyyy-MM-dd”/>”
Change the pattern to “dd/MM/yyyy”
July 14, 2011 at 9:11 pm #318237
giann_mgaMemberIt doesn’t works. When i put pattern=”dd/MM/yyyy” the field datnas doesn’t appears in jsp page.
July 15, 2011 at 4:59 am #318245
support-joyMembergiann_mga,
I do not have a visual on your project / jsp. Could you send me the whole code. One thing of interest is
<input id=”associado_datnas” name=”datnas” type=”text” value=”<fmt:formatDate value=”${associado.datnas.time}” pattern=”yyyy-MM-dd”/>” dojoType=”dijit.form.DateTextBox” constraints=”{datePattern:'<fmt:message key=”date.format”/>’}” trim=”true” promptMessage=”<fmt:message key=”date.format” />” invalidMessage=”<fmt:message key=”date.format.invalid” /> <fmt:message key=”date.format” />.” style=”width:300px;” />
Before you change the format of the date, could you confirm if you are able to see the date with below syntax
<fmt:formatDate value=”${associado.datnas.time}” />”
If the above does not show date, try
<fmt:formatDate value=”${associado_datnas.time}” />”, since the id you have mentioned is
“associado_datnas”, I believe you are facing syntax issue here.July 15, 2011 at 7:38 am #318257
giann_mgaMemberI’m from Brazil, my date format is ‘dd/mm/yyyy’. The question is: how can i change my regional settings for all projects to this date format?
July 18, 2011 at 10:24 am #318302
support-joyMembergiann_mga,
What are you trying to achieve? Please refer http://support.microsoft.com/kb/307938 – how to change the regional settings in windows XP.
January 6, 2014 at 1:06 am #345766
herbertadolphMemberIt is required to change it every page ?
January 8, 2014 at 6:22 am #345834
support-swapnaModeratorherbertadolph,
What exactly is your issue with respect to Dates?
If you have a date input in more than one jsp and you need to change the format for the date input, then you have to change it in all the jsps.Let us know if this does not help.
-
AuthorPosts