Re: WebObjects 5.3.3, DST and J2SE 1.4.2
Re: WebObjects 5.3.3, DST and J2SE 1.4.2
- Subject: Re: WebObjects 5.3.3, DST and J2SE 1.4.2
- From: Baiss Eric Magnusson <email@hidden>
- Date: Wed, 7 Mar 2007 08:34:56 -0800
I've been gathering this response, but Ken has been so helpful and
right on with his comments that I thought I should reply.
I have work to do. I will have to create the UI to get the timezone,
store the timezone in the database, and use it in the various date
displays.
Other comments below.
Do you adjust the time the user sees based on a timezone of the
user? My typical approach to this problem is to have the server
run completely in GMT, and find out from the browser what timezone
the user is in. That way, if the user has an appointment at 11 AM
in New York and then he logs in when in California, it will say 8 AM.
Of course, if you have a repeating event, and that event is stored
as GMT, you will have to adjust for DST yourself. A repeating
calendar event might be better stored by storing the local time and
timezone in your database so that it can be properly displayed at
all times.
I've fallen in this battle more than a half-dozen times before.
I don't use NSTimeZone or <setDefault> at all.
I use a WOString <eventItem.eventDate> with a <dateFormat> of <"%I:%
M %p">.
Where <eventItem.eventDate> is the complete date/time NSTimestamp
coming from the database, where it is stored as a <timestamp> based
upon GMT.
It seems to me that I need to go back and associate a time zone id
for all my events.
and then use this
tz = NSTimestamp.....
NSTimestamp myNSTimestamp = new NSTimestamp(year, month, day, hour,
minute, seconds, tz)
On Mar 6, 2007, at 4:05 PM, Chuck Hill wrote:
NSTimestamp is always in GMT. You need run it through a formatter
to convert to the local time zone.
Chuck
On Mar 6, 2007, at 4:02 PM, Baiss Eric Magnusson wrote:
2003-03-11 19:00:00.000
is how a date looks like to me in the DB, this I translate to 7PM
P?T (ie PST or PDT).
From the above does that imply, which I believe is correct, that
the timezone is GMT?
I guess I thought the default time zone, that is the time zone of
the JVM on the server, would be used in the default new NSTimestamp
();
On Mar 6, 2007, at 1:27 PM, Ken Anderson wrote:
On Mar 6, 2007, at 4:20 PM, Baiss Eric Magnusson wrote:
But I don't get the DST fix. All the times are wrong in three
different WO calendar sites, even though
<cat /System/Library/Frameworks/JavaWebObjects.framework/
Resources/version.plist>
says I've got WO 5.3.3 running.
<http://www.nwsufis.org/cgi-bin/WebObjects/nwsufis>
Notice the event times on March 6th and 13th, for a weekly
<repeating event>.
Baiss,
Actually, I'd be willing to bet this actually *proves* you have
the DST fix. If you didn't, you wouldn't be seeing a change
across March 11th, it would be across April 1. It's my guess
that you're storing the dates in GMT and adjusting to local
time... in which case, everything is working correctly (from a
Java DST point of view anyway).
Ken
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden