• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: timezone for web users?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: timezone for web users?


  • Subject: Re: timezone for web users?
  • From: Ken Anderson <email@hidden>
  • Date: Tue, 09 Jul 2013 08:26:56 -0400

Every app I have makes similar default calls.

On Jul 8, 2013, at 8:34 PM, Paul Hoadley <email@hidden> wrote:

On 09/07/2013, at 3:29 AM, Jesse Tayler <email@hidden> 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.


-- 
Paul Hoadley
http://logicsquad.net/


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
  • Follow-Ups:
    • Re: timezone for web users?
      • From: Jesse Tayler <email@hidden>
References: 
 >timezone for web users? (From: Jesse Tayler <email@hidden>)
 >Re: timezone for web users? (From: Ramsey Gurley <email@hidden>)
 >Re: timezone for web users? (From: Jesse Tayler <email@hidden>)
 >Re: timezone for web users? (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: Need help with building tricky qualifier
  • Next by Date: do I have to clone ERCoreBusinessLogic?
  • Previous by thread: Re: timezone for web users?
  • Next by thread: Re: timezone for web users?
  • Index(es):
    • Date
    • Thread