ya, timezones are ALWAYS a problem.

I have no idea where or why I had those static defaults but clearly, things are 
better without them.

Maybe I have trouble in ERRest now...I’ll report if I see more about it.

Ramsey’s component has done well at figuring the TZ during normal web use, so — 
so far, so good.




On Jul 8, 2013, at 8:40 PM, Chuck Hill <[email protected]> wrote:

> 
> On 2013-07-08, at 5:34 PM, Paul Hoadley wrote:
> 
>> On 09/07/2013, at 3:29 AM, Jesse Tayler <[email protected]> wrote:
>> 
>>> I realize I had apparently statically set the timezone to GMT?
>>> 
>>> Maybe I did this for my database??
>>> 
>>> I had this in my app constructor
>>> 
>>>     static {
>>>             // Set default time zones
>>>             //TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
>>>             //NSTimeZone.setDefaultTimeZone(NSTimeZone.getGMT());
>>>     }
>>> 
>>> once I noticed those two line and commented them out, general <wo:str>’s 
>>> zapped into a correct timezone on display - my component is another story 
>>> but--
>>> 
>>> now I wonder if I’ll be storing my dates differently in the database?
>> 
>> In my experience, you almost certainly want to leave those setDefault calls 
>> _in_.  The only failsafe way to deal with timezones is to set UTC everywhere 
>> except the view layer.  So, yes, you want to ensure your database is storing 
>> timestamps as UTC (and not doing any "helpful" timezone conversions on the 
>> way in or out), the JVM's default is UTC, and WebObjects default is UTC.  
>> The only time you do a conversion is on the way in from the view, or on the 
>> way out to the view, both using a user-selected or automatically-detected 
>> timezone offset.
> 
> Having spent many quality hours with time zones and time stamps in WO, I 
> completely agree with Paul.  Madness lies in any other direction.
> 
> 
> Chuck
> 
> 
> -- 
> Chuck Hill             
> Executive Managing Partner, VP Development and Technical Services
> 
> Practical WebObjects - for developers who want to increase their overall 
> knowledge of WebObjects or who are trying to solve specific problems.    
> http://www.global-village.net/gvc/practical_webobjects
> 
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing 
> Companies in B.C! 
> 
> Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of 
> Canada’s Fastest-Growing Companies by PROFIT Magazine!

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to