voyent
selectInputDate day-off problem, even tried solutions in the board.  XML
Forum Index -> General Help
Author Message
ron_8

Joined: 28/Mar/2013 21:40:39
Messages: 2
Offline


Hi All,

Good Day.

I have a problem with my code, i have a bean that passes the date and when the screen loads, the selectInputDate field is 1-day off. I tried solutions in this board but it still is not working, right now I have these codes:

xhtml
Code:
 <ice:selectInputDate id="Dates_1" renderAsPopup="true"
 	disabled="false"
 	value="#{InputBean.datesWrapper.complexType['TDate']}">
 	<f:convertDateTime locale="en" type="date" pattern="dd/MM/yyyy"
 		timezone="#{InputBean.timeZone}"/>
 </ice:selectInputDate>
 


bean
Code:
 public TimeZone getTimeZone() {
       return TimeZone.getDefault();
 }
 


but still when page loads, the day is 1 day off the date i have in the bean.

anything i'm doing wrong? thanks in advance :) been stuck with this issue for 2 days now :(
arran.mccullough


Joined: 02/Jan/2007 00:00:00
Messages: 426
Offline


Hello,

Sounds like an issue with the time zone setting to me. The code you have should work fine as that is what we recommend. Using the getDefault() will use the servers JVM timezone. Possibly there is an issue with your JVM settings?

Just to confirm a few things:
- Does the issue happen when you select a date?
- Is this only an issue when the date is loaded from your bean?
- Is there any difference if you use a simple value binding to a Date object?

Regards,
Arran

Arran McCullough
Technical Support Engineer
ICEsoft Technologies Inc.
ron_8

Joined: 28/Mar/2013 21:40:39
Messages: 2
Offline


Hi, thanks for the reply.

to answer your questions:
- No, it does not. it only happens when the page loads. there is a date value in the bean and it is loaded onto this screen, but the date showing in this inputdate field is 1-day off.
- Yes
- no, 1-day off still.
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Perhaps the default jvm time zone is set to GMT, which might be rolling over from your local date. Try setting the time zone manually to your local:

Code:
 public TimeZone getTimeZone() {
        return TimeZone.getTimeZone("Asia/Shanghai");
  }
 

.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team