Results 1 to 2 of 2
  1. #1
    bindhuuk4 is offline Member
    Join Date
    Aug 2009
    Posts
    1
    Rep Power
    0

    Unhappy Gregorian Calendar

    Hi All,

    Can anyone please say me what is the difference between Gregorian Calendar in Java 1.4 and the Gregorian Calendar in Java 1.5.

    I try the following code in Java 1.5.
    GregorianCalendar gCal = new GregorianCalendar(1970,01,01);
    gCal.set(Calendar.HOUR, 02);
    gCal.set(Calendar.MINUTE, 17);
    gCal.set(Calendar.SECOND, 35);
    and the output returned is 2666855000 (In Java 1.5)

    But the same logic gives me another output in Java 1.4.
    Please let me know what is the difference. I need this to be resolved ASAP.

    Thanks in Advance
    Bindhu

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    Quote Originally Posted by bindhuuk4 View Post
    I try the following code in Java 1.5.
    GregorianCalendar gCal = new GregorianCalendar(1970,01,01);
    gCal.set(Calendar.HOUR, 02);
    gCal.set(Calendar.MINUTE, 17);
    gCal.set(Calendar.SECOND, 35);
    and the output returned is 2666855000 (In Java 1.5)
    I get 2683055000, so I'm guessing it's a timezone thing.

Similar Threads

  1. Calendar bug?
    By Stigvig in forum Advanced Java
    Replies: 14
    Last Post: 02-08-2009, 09:56 AM
  2. calendar
    By John in forum SWT / JFace
    Replies: 12
    Last Post: 08-07-2008, 10:54 PM
  3. Creating a Gregorian Calendar using a Date object gives date - 1
    By prachi_goliwadekar in forum New To Java
    Replies: 1
    Last Post: 05-08-2008, 08:32 PM
  4. Help with gregorian calendar
    By osval in forum New To Java
    Replies: 2
    Last Post: 08-06-2007, 11:21 PM
  5. Gregorian calendar issue
    By orchid in forum New To Java
    Replies: 1
    Last Post: 05-16-2007, 06:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •