• Post Reply Bookmark Topic Watch Topic
  • New Topic

'07/01/2010' could not be understood as a date.

 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use JSF 2 and have that:



when putting this value into the field:


or
a timestamp


then I get this error:

could not be understood as a date.

So what dateform does jsf understand?
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default JSF will take the format as "Sep 3, 2010" ("MON dd, YYYY"), but you can specify the pattern by using the <f:dateTimeConverter pattern="MM/dd/yyyy" /> inside the <h:inputText /> tag.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello thanks,

this is working:




however, when I put

2010-00-02 08:00:00

then jsf convert this to this date:

Sun Jan 03 09:00:00 CET 2010


I want to have this date:

Sun Jan 03 08:00:00 CET 2010


Why is that so? Because of timezone? How can I disable that.
 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure but you can add a timeZone attribute to your converter For ex: timeZone="Europe/Rome"
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I use the timezone-prop, now it works. thanks

BUT:

the converter complains about this date:

2010-09-01 15:00:00

because I use 15:00:00 instead of 03:00:00 pm


This is working:

2010-09-01 03:00:00

However, 03:00:00 in the morning is not the same as in the afternoon.

How can I solve that?
 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be due to the fact that you are using hh for hours try using HH or kk
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, thanks !!

with HH it works!

 
Sridhar Santhanakrishnan
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!