| Author |
Message |
|
|
Post subject: date format
Posted: Jul 13, 2011 - 03:47 PM
|
|
Registered Member

Joined: May 27, 2011
Posts: 9
|
|
How can i change input date format to 'dd/mm/yyyy' in jsp pages? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 13, 2011 - 04:49 PM
|
|
Registered Member


Joined: Feb 03, 2009
Posts: 3442
|
|
giann_mga,
Try the following -
DateFormat dateFormat= new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date= new Date();
String dateString= dateFormat.format(date); |
_________________ Joy
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject: date format
Posted: Jul 13, 2011 - 07:30 PM
|
|
Registered Member

Joined: May 27, 2011
Posts: 9
|
|
Where 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;" /> |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 14, 2011 - 10:34 AM
|
|
Registered Member


Joined: Feb 03, 2009
Posts: 3442
|
|
giann_mga,
| Quote: | | <fmt:formatDate value="${associado.datnas.time}" pattern="yyyy-MM-dd"/>" |
Change the pattern to "dd/MM/yyyy" |
_________________ Joy
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject: date format
Posted: Jul 15, 2011 - 03:11 AM
|
|
Registered Member

Joined: May 27, 2011
Posts: 9
|
|
It doesn't works. When i put pattern="dd/MM/yyyy" the field datnas doesn't appears in jsp page. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 15, 2011 - 10:59 AM
|
|
Registered Member


Joined: Feb 03, 2009
Posts: 3442
|
|
giann_mga,
I do not have a visual on your project / jsp. Could you send me the whole code. One thing of interest is
| Quote: |
<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. |
_________________ Joy
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject: date format
Posted: Jul 15, 2011 - 01:38 PM
|
|
Registered Member

Joined: May 27, 2011
Posts: 9
|
|
I´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? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 18, 2011 - 04:24 PM
|
|
Registered Member


Joined: Feb 03, 2009
Posts: 3442
|
|
|
_________________ Joy
MyEclipse Support
|
| |
|
|
|
 |
|
|