posted 12 years ago
Hi All,
So this should be simple, but I can't figure it out. No matter what I do, my local timezone displays as GMT-5:00.
I need it to display as EDT/EST because I want to set a milli date and then query whether its in daylight savings time or not
but setting the timezone object with tz.setTimeZone("America/New_York") displays GMT-5:00
when I display a date in september. I've tried setting the user.timezone property in sys.
I've tried setting in SimpleDateFormat as well. My Code looks like this:
My output returns:
12/14/2012 05:47 GMT
Timezone =GMT-05:00
Date = Fri Dec 14 05:47:34 GMT 2012
Calendar = java.util.GregorianCalendar[time=1355464054992,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=2012,MONTH=11,WEEK_OF_YEAR=50,
WEEK_OF_MONTH=3,DAY_OF_MONTH=14,DAY_OF_YEAR=349,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=2,
AM_PM=0,HOUR=5,HOUR_OF_DAY=5,MINUTE=47,SECOND=34,MILLISECOND=992,ZONE_OFFSET=0,DST_OFFSET=0]
I'm sure I don't understand something but I'm stuck.
btw: my actual timezone is EST which is equivalent to GMT-05:00, but I don't understand why it displays as a
custom timezone rather than just EST. And why the calendar object and Date object both display GMT.
Thanks in advance
Randy