The bug of course is in Calendar.

John Reynolds wrote:

> Hmm is there something wrong with me or is it pre2 problem.
>
> Note the minute field in the time stamp
> 1999-11-03 23:46:56.0
>                                 ^^
>
> and compare it to that in minute field of the calandar object
> java.util.GregorianCalendar
> [time=941672816000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,
> 
>zone=java.util.SimpleTimeZone[id=IST,offset=19800000,dstSavings=3600000,useDaylight=false,
>
> 
>startYear=0,startMode=0,startMonth=0,startDay=0,startDayOfWeek=0,startTime=0,endMode=0,endMonth=0,endDay=0,endDayOfWeek=0,endTime=0],
>
> firstDayOfWeek=1,minimalDaysInFirstWeek=1,
> ERA=1,
> YEAR=1999,
> MONTH=10,
> WEEK_OF_YEAR=45,
> WEEK_OF_MONTH=1,
> DAY_OF_MONTH=4,
> DAY_OF_YEAR=308,
> DAY_OF_WEEK=5,
> DAY_OF_WEEK_IN_MONTH=1,
> AM_PM=0,
> HOUR=5,
> HOUR_OF_DAY=5,
> MINUTE=16,
>                        ^^
> SECOND=56,
> MILLISECOND=0,
> ZONE_OFFSET=19800000,
> DST_OFFSET=0]
>
> Seems to be 30 mins off.
>
> Code snippent is
>
>                 java.util.Date dateat = new java.util.Date((time.longValue() * 
>1000));
>                 // time is a Long in seconds, 1000 is to convert to milliseconds
>                 TimeZone tz = TimeZone.getTimeZone("IST");
>
>                 Timestamp stamp = new Timestamp(dateat.getTime());
>                 System.out.println(stamp);
>
>                 dates[j] = GregorianCalendar.getInstance();
>                 dates[j].setTimeZone(tz);
>                 dates[j].setTime(stamp);
>
>                 System.out.println(dates[j]);
>
> Comments?
>
> John
>
> --
> ==============================================================================
>         Beta may be a state of mind
>         But Alpha is the state of being
> ==============================================================================

--
==============================================================================
        Beta may be a state of mind
        But Alpha is the state of being
==============================================================================




----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to