I know this has been beat to death, and I tried to search first, but I can't seem to figure out way I get the wrong hour printed out such that it's 8 hours later than my current local time and into the next day respectively:
<code> ----------- CONSOLE OUTPUT --------------
nico@toshiba:~/progs/checkouts/java/java_progs/sierra_self_tests/chapter6$
java dates
Mon Jan 14 00:57:27 GMT 2008
Mon Jan 14 00:57:27 GMT 2008 c.toString(): java.util.GregorianCalendar[time=1200272247544,areFieldsSet=true,areAllFieldsSet=true,lenient=true,
zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],
firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=0,WEEK_OF_YEAR=3,WEEK_OF_MONTH=3,
DAY_OF_MONTH=14,DAY_OF_YEAR=14,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=0,
HOUR_OF_DAY=0,MINUTE=57,SECOND=27,MILLISECOND=544,ZONE_OFFSET=0,DST_OFFSET=0]
after c.add(Calendar.HOUR, 2) as date: Mon Jan 14 02:57:27 GMT 2008
after c.add(Calendar.HOUR, -5) as date: Sun Jan 13 21:57:27 GMT 2008
</code>
And then right after I use the date shell command:
<code>
nico@toshiba:~/progs/checkouts/java/java_progs/sierra_self_tests/chapter6$
date
Sun Jan 13 16:57:38 PST 2008 </code>
[ broke up really long line that was messing up the page formatting - Jim ]
[ January 13, 2008: Message edited by: Jim Yingst ]