Calender.getTime is displaying wrong date(One day earlier then the current)

I am trying to display date from a calender object. My code is
<h:outputText value="#{documentActivity.createdDate.time}" />
createdDate is a calender object.
this output is wrong, if the date is 05/28/07, this displays as 05/27/07.
When I try to print the same from a java class it prints fine...
createdDate.getTime().
Has anyone faced this issue, Is there a problem with the JSF tag?

Which JSF version? Do you use a converter?
I can't reproduce it here in 1.2_04 with the following basic snippets:<h:outputText value="#{myBean.date}" /><br>
<h:outputText value="#{myBean.calendar.time}" /><br>
<h:outputText value="#{myBean.date}"><f:convertDateTime/></h:outputText><br>
<h:outputText value="#{myBean.calendar.time}"><f:convertDateTime/></h:outputText><br>MyBeanpublic Date getDate() {
    return new Date();
public Calendar getCalendar() {
    return Calendar.getInstance();
}It all shows valid dates.

Similar Messages

  • Displaying wrong date(One day earlier then the current)

    Has anyone experienced this problem. I have an inputText field that is to take in a date value. When I use the DateTimeConverter to check if the date is valid, the returned date valu is always one day earlier than the user input day.
    How do I resolve this. Is there a setting that I need to change?
    Thanks in advance.
    -Meena

    Which JSF Implementation is this code extract from?
    I am using IBM WebSphere 6.0 and also experiencing a problem with an InputText displaying the day before. For example when the InputText value is set to 21-Apr-2007, 20-Apr-2007 is displayed. Here is a simplified version of what I'm doing:
    Page - inputTextDates.jsp
         <h:inputText id="opDate" styleClass="inputText"
              binding="#{inputTextDatesBean.htmlInputText}">
         </h:inputText>
    Request-Scope Bean - InputTextDates.java
         private HtmlInputText htmlInputText;
         public HtmlInputText getHtmlInputText() {
              if (this.htmlInputText == null) {
                   this.htmlInputText = new HtmlInputText();
                   // create a calendar for manipulating dates for the chosen timezone
                   GregorianCalendar gregorianCalendar = new GregorianCalendar(TimeZone.getTimeZone("US/Central"));
                   gregorianCalendar.setTime(new Date(107, 3, 21));
                   // create a date time converter for the timezone
                   DateTimeConverter dateTimeConverter = new DateTimeConverter();
                   dateTimeConverter.setTimeZone(gregorianCalendar.getTimeZone());
                   // create a calendar picker
                   HtmlInputHelperDatePicker htmlInputHelperDatePicker = new HtmlInputHelperDatePicker();
                   htmlInputHelperDatePicker.setId("myId"); // have to give an ID
                   // populate the input text
                   this.htmlInputText.setValue(gregorianCalendar.getTime());
                   this.htmlInputText.setConverter(dateTimeConverter);
                   this.htmlInputText.getChildren().add(htmlInputHelperDatePicker);
              return this.htmlInputText;
         public void setHtmlInputText(HtmlInputText htmlInputText) {
              this.htmlInputText = htmlInputText;
         }

  • Anyone had an issue on iphone 4s where bluetooth connects one day and then the next will not discover anything, but then a little while later it works again?  I have 2 audio devices and an apple keyboard that I have this issue with. Effects ALL.

    I have an iphone 4s.  A while ago it started having issues with bluetooth.  All of the sudden, an audio headset I am using quits working with my iphone bluetooth.  I check and my iphone doesn't see any of my bluetooth devices.  I have an apple keyboard, a headset, and a speaker.  Nothing shows up on my iphone but they all connect perfectly to my ipad.  Then a day or so later it works again. The are all suddenly there.  I just installed iOS7 and I'm still having the same problem. What is UP?  Anyone have a clue what is going on?

    I have this problem too. I have an iPhone 4, and this wasn't a problem when I bought the phone back in December. I think it came a month or so later and I suspect with a standard upgrade of something like itunes, or iphone software... but I can't pinpoint it to any specific update as it took me a while to notice it. For me, it does this with my work calendar which is run through Microsoft Outlook. But it's the exact same thing - and it means my calendar isn't reliable anymore.
    I've made sure the time-zone settings are correct, I've updated all software, and gone through all possible settings for both my i-phone and Outlook. Nothing fixes the problem, even our tech guy at work didn't know what to do. I know it's not just my phone as the exact same thing has happened with my boss's iPhone which is an iPhone 3G, and it frustrates him to no end.
    I'm really hoping someone at apple can tell us what's going on, especially since it never used to do this and there doesn't seem to be any way to fix it. If someone thinks they know what itunes update this was due to, let me know - I'll see if I can go back to that older version.

  • Dates one day behind after java upgrade to 1.6.0_27

    I have upgraded from Java 1.5.0_06 to 1.6.0_27
    After the upgrade ,I saw that dates are a day behind.All dates that lie between November 6th to March 10th are correct but dates
    lying between March 10th to November 5th for any year are wrong.(one day behind)
    Is it something to do with DayLight saying.
    I am using GMT-5 Eastern Time(US & Canada) and Server is set to automatically adjust time coressponding to day light saving.
    I checked,I get the date correct from database and in the factory class also it is correct,in the servlet it is correct but my Viewclass which calls this servlet shows date one day behind.
    I am doing no conversion ,the date fetched from database is stored like
    java.sql.Date beginDate= resultSet.getDAte("BeginDate")
    Schedule.setBegindate(beginDate)
    In the Schedule Object ,the beginDAte is of type Date.
    I am adding all dates to a treeset.I do a printout just after setting,it is correct
    But in my view class ,its one day behind,no manipulation is done.Dont know why is the day incorrect.
    IS it because of Java version.
    Please help

    As I mentioned That
    My view class TestView code is some what like this
    public class TestView extends JFrame
    public TestView(URL url, AppletContext appletContext)
    this.appletContext = appletContext;
    SwingUtilities.invokeLater(new Runnable() {
    public void run()
    testCommand test= new GetDatesCommand();//call factory class which fetches result from database
    Object returnValue = TestUtils.callServlet(test);//calls the servlet .
    if( returnValue instanceof TreeSet )
    TreeSet testSet= (TreeSet)returnValue;
    TestView.setDate(testSet));
    I am calling this constructor of viewtest class from my LoginTestApplet
    public class LoginTEstApplet extends JApplet
    public LoginApplet()
    TimeZone.setDefault(TimeZone.getTimeZone("EST"));
    LoginTestActionperformed()
    new testView(getDocumentBase(), this.getAppletContext());
    As I mentioned the values of dates as fetched from database ,factory class and getDatesCommand class prints fine.Its just inside this class after the call to servlet ,it displays wrong date.
    I have an applet ,LoginTestApplet which is the entry point for my application.Inside the default constructor ,I am doing
    TimeZone.setDefault(TimeZone.getTimeZone("EST"));
    I have mentioned in my second post what results it shows for getDefaults.
    I know its very strange ,the dates gets one day behind immedately only in the view class not in the servlet or the factory class.
    Please let me know if I need to post some more data .

  • Why do the recurring dates, like birth dates Onmy IPad and my iPhone move one day earlier in2015

    Why do the recurring dates, like birth dates on my  IPad and my iPhone move one day earlier in 2015?

    I have no idea why that might occur, all the birthdays and a couple tech sessions that I have in mine appear correrct.
    Are they birthdays that youy entered to calendar and possibly selected to repaet on 2nd friday of feb?
    Not an option if birthday is coming from contacts app, though.

  • Does any one know if the iPhone camera one day will have the ability to date stamp photos taken with the iPhone

    Does any one know if the iPhone camera one day will have the ability to date stamp photos taken with the iPhone

    No one but Apple knows what will come in the future until they announce it. We are forbidden from speculating about it on these forums.

  • Birthday calendar on iPad  one day early with iOS5

    The birthday calendar shows all birthdays one day early after upgrade to iOS5 on original iPad. I have all the automatic time adjustments and location recognition on. What is wrong?

    I have read that this is a bug, here is a fix which has worked for me at least for the time being:
    Here is a process that worked for me to correct the information in Calendars re birthdays appearing one day out:
    (1) If your iPad/phone is syncing contacts with iCloud, turn it off. In Settings on your iPad/phone, Mail,Contacts,Calendars, Accounts, iCloud, turn off Contacts.
    (2) sync your iPad/phone to iTunes.
    (3) now select the ‘Info’ tab in iTunes for your iPad/iPhone. Ensure that ‘Sync Address Book Contacts’ is ticked. (You can revert to syncing with iCloud later, after this process is complete.)
    (4) scroll to the very bottom section of the Info tab. Where it says ‘Replace information on this iPad/iPhone’, select ‘Contacts’.
    (5) Sync again.
    Now check Calendars on iPad/iPhone, this process ‘fixes’ the information of birth dates and they should now appear correctly.
    Thanks to @fortbailey for this. By the way Steff_BKK, is one of your email accounts an Exchange account? (This has been reported as something to do with this bug.)

  • Birthdays on my calendar are one day early

    Has anyone had this issue before?  After I switched over to a 4S from a 3G, I noticed that all my contacts' birthdays are showing up one day early on my calendar.  However, when I go to the contact entry in the address book, it displays correctly there.  What's weird about this issue is that both my mac and ipad display birthdays using the same method and it's correct on both of those.  They all sync via mobileme, and running iOS5 and Snow Leopard.
    Before erasing my phone's contacts, and trying to resync them, I was wondering if this could be fixed via the phone, or the bug isolated and sent up to Apple's software department.
    Thanks!

    dom_99, this worked for me: (thanks to @fortbailey)
    (1) If your iPad/phone is syncing contacts with iCloud, turn it off. In Settings on your iPad/phone, Mail,Contacts,Calendars, Accounts, iCloud, turn off Contacts.
    (2) sync your iPad/phone to iTunes.
    (3) now select the ‘Info’ tab in iTunes for your iPad/iPhone. Ensure that ‘Sync Address Book Contacts’ is ticked. (You can revert to syncing with iCloud later, after this process is complete.)
    (4) scroll to the very bottom section of the Info tab. Where it says ‘Replace information on this iPad/iPhone’, select ‘Contacts’.
    (5) Sync again.
    Now check Calendars on iPad/iPhone, this process ‘fixes’ the information of birth dates and they should now appear correctly.

  • Calendar appointments and birthdays in contacts appear one day early? iOS 5.0.1 on iPhone 4S

    Hello, About a week or two ago, I noticed all my appointments were on my calendar a day early, as well as birthdays in my contacts.  I sync my phone with my Macbook using Address Book and Calendar; had done this previous with my iPhone 3GS running iOS 5.0.1 without issue.  I unsynced my calender, and then re-synced it, and this corrected the calendar appointments.  However, birthdays still show up a day early on the calendar.  When I look in Contacts, the birthdays are correct.  Has anyone seen this before?  Thanks! --Matthew

    this worked for me: (thanks to @fortbailey!)
    (1) If your iPad/phone is syncing contacts with iCloud, turn it off. In Settings on your iPad/phone, Mail,Contacts,Calendars, Accounts, iCloud, turn off Contacts.
    (2) sync your iPad/phone to iTunes.
    (3) now select the ‘Info’ tab in iTunes for your iPad/iPhone. Ensure that ‘Sync Address Book Contacts’ is ticked. (You can revert to syncing with iCloud later, after this process is complete.)
    (4) scroll to the very bottom section of the Info tab. Where it says ‘Replace information on this iPad/iPhone’, select ‘Contacts’.
    (5) Sync again.
    Now check Calendars on iPad/iPhone, this process ‘fixes’ the information of birth dates and they should now appear correctly.

  • Ipad calendar events are one day early

    Hello,
    I recently switched over to iCloud. And now all-day events are one day early on my iPad only. The dates are fine when I look at iCal on the web, and they're fine on my Mac Pro and my MacBook. I tried resetting the iPad, and it didn't fix it. The time zone is was set to automatic, I tried setting it to manual, but still no change. Any other ideas?
    thanks!
    Joe

    All of my dates are out by one day in ical (and address book). I can change them manually (best advice I could get from Apple), but it keeps happening to me. Any help appreciated, I have 10.8.6; macbook pro, iphone 4s and am frustrated. This seems to be a common problem but I can't find a fix. 
    In the post above advice is to go to itunes, "info tab", Advanced...but I don't see an "info tab" -
    Thanks for any help!
    Joan

  • Birthdays show up on the calendar one day early.

    All of the Birthdays that I loaded in the contacts show up one day early on my calendar.  Has anyone else seen this or does anyone know what I am doing wrong?

    Have a look at left "More Like This" section.

  • Birthday showing up on iCal one day earlier?

    Hi everybody! I am pretty new here. So I hope someone could assist me.
    I have set up my contacts on iPhone 4s with birthday dates. But unfortunately they are
    all showing up one day earlier on my iPhone iCal - they do show up correct in the contacts and also
    on my iCal of my MacBook.... Any ideas? Much appreciated...

    Hey John
    Thanks a bundle, it turned out that was the problem, I was on some kind of pacific time zone,
    Cheers
    Michaël

  • "All-day" events in iCal appear one day early in week-view on iPad

    Just got an iPad and synced with iCal. I noticed that "all day" events appear correctly in day-view and month-view, but in week-view, they are shifted one day earlier. But if I choose to edit such an event, the information is still correct, e.g. an all-day event for Monday, May 31 and Tuesday, June 1, has that information, and it appears on Monday and Tuesday in day- and month-view, but in week-view, it has "slid left" such that it appears on Sunday and Monday. Anyone else seeing this? Any solutions?

    I have the same issue on all day events synced from Exchange. The items look fine in the day or month view.

  • IPhone/iPad calendar holidays show one day early?

    I recently noticed that all of my holidays on my iPad Air and iPhone 5 show one day early.  For example, Christmas shows as being on December 24th.  Every holiday is like this.  I sync with Outlook 2007 and in there are 3 calendars:  "Calendar", "Calendar in iCloud", and "Mobile Calendar in iCloud".  The incorrect holidays are listed under "Calendar in iCloud".  Of course, I can simply uncheck the calendar and the holidays disappear but I'd kind of like them there.  Correctly.  Any suggestions?

    FWIW, I have no such problem.....  Of course, I am "plain vanilla" Apple.
    Barry

  • After iOS 5 update my iCal shows all my registered Birthdays one day earlier. Can anybody help? thx

    After iOS 5 update my iCal shows all my Birthdays one day earlier. Please help. thx

    Same issue here.  In searching through Apple Discussions site I see this has been happening for at least 5 years now were b-days can pop up 1 or even 2 days early.  Really Apple?  I am disappoint. 

Maybe you are looking for