• 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: WebObjects 5.3.3, DST and J2SE 1.4.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebObjects 5.3.3, DST and J2SE 1.4.2


  • Subject: Re: WebObjects 5.3.3, DST and J2SE 1.4.2
  • From: Ken Anderson <email@hidden>
  • Date: Wed, 07 Mar 2007 11:48:19 -0500


On Mar 7, 2007, at 11:34 AM, Baiss Eric Magnusson wrote:

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.


Thanks.  One thing you might consider is using this _javascript_:

// This code lifted from 'http://www.mkolar.org/_javascript_/clock.html' and liberally modified

var msie = navigator.userAgent.indexOf("MSIE");
var now = new Date();
var clientTimeZoneOffset = now.getTimezoneOffset(); // = what browser thinks is TZ; but
        // MS IE version 3 gives wrong sign of TZ
// MSIE 4.0b2 shifts TZ by -1 hour
// Any other problems?

if (clientTimeZoneOffset) {
  if (msie > -1) {
    if (navigator.userAgent.substring(msie+5,msie+6) <= 3) {
      clientTimeZoneOffset *= -1;
    } else {
      if (navigator.userAgent.indexOf("4.0b2") > -1) {
        clientTimeZoneOffset += 60;
      }
    }
  }
  document.write('<input type="hidden" name="x-clientTimeZoneOffset" value="' + clientTimeZoneOffset * 60 * -1 + '" />');
}

It creates a header that specifies the timezone as the client machine sees it.  I drop this _javascript_ into a WO component that grabs the timezone from the header and sets it in the user's session.

Ken
 _______________________________________________
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: WebObjects 5.3.3, DST and J2SE 1.4.2, parse javascript help
      • From: Baiss Eric Magnusson <email@hidden>
References: 
 >WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Baiss Eric Magnusson <email@hidden>)
 >Re: WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Pascal Robert <email@hidden>)
 >Re: WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Baiss Eric Magnusson <email@hidden>)
 >Re: WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Ken Anderson <email@hidden>)
 >Re: WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Baiss Eric Magnusson <email@hidden>)
 >Re: WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Chuck Hill <email@hidden>)
 >Re: WebObjects 5.3.3, DST and J2SE 1.4.2 (From: Baiss Eric Magnusson <email@hidden>)

  • Prev by Date: Re: WebObjects 5.3.3, DST and J2SE 1.4.2
  • Next by Date: Direct Actions Question
  • Previous by thread: Re: WebObjects 5.3.3, DST and J2SE 1.4.2
  • Next by thread: Re: WebObjects 5.3.3, DST and J2SE 1.4.2, parse javascript help
  • Index(es):
    • Date
    • Thread