• 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: storing NSTimestamp values as GMT, displaying as (client) local?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: storing NSTimestamp values as GMT, displaying as (client) local?


  • Subject: Re: storing NSTimestamp values as GMT, displaying as (client) local?
  • From: Andrew Lindesay <email@hidden>
  • Date: Wed, 15 Apr 2009 13:04:46 +1200

Hello Leif;

1. Do I need to worry about setting the timezone in the EOModel for all my NSTimestamp attributes? Or is calling NSTimeZone.setDefaultTimeZone(NSTimeZone.getGMT()) in my Application constructor good enough?

I'm not sure what that value is used for in the EOModel -- anybody know?

I do this in the Application constructor...

	TimeZone tz = getTimeZone();

	if(null!=tz)
	{
		TimeZone.setDefault(tz);
		NSTimeZone.setDefault(tz);

if(getBootLogger().isLoggable(java.util.logging.Level.INFO))
getBootLogger().info("application timezone set to '"+tz.getDisplayName()+"'");
}


I avoid use of NSTimeZone and NSTimestampFormatter in general though.

2. Do I need to worry about configuring Postgres to set it's default timezone?

There is some coverage of this here;

	http://www.postgresql.org/docs/8.3/interactive/datatype-datetime.html

However I have used PG extensively with WO and just using the "TIMESTAMP" type which seems to result in no zone-adjusting.

3. How can I get the local timezone (of the browser client) so that I can use it for my WOTextfield formatters (to display local time)?

Either guess this from information on the inbound domain / the browser's headers or configure a time-zone in the database's records for the authenticated user.


4. Anything else I need to worry about, or not thinking of?

Check out the following for some ideas even though you are probably not using LEWOStuff;


	http://homepage.mac.com/andrewlindesay/le/manuals/lewostuff/LEWOStuffOverview.pdf
	(6.22 "TimeZone, Date and...")

Hope this helps.

cheers.

___
Andrew Lindesay
www.lindesay.co.nz

_______________________________________________
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: storing NSTimestamp values as GMT, displaying as (client) local?
      • From: Travis Britt <email@hidden>
References: 
 >storing NSTimestamp values as GMT, displaying as (client) local? (From: Leif Harrison <email@hidden>)

  • Prev by Date: storing NSTimestamp values as GMT, displaying as (client) local?
  • Next by Date: Re: storing NSTimestamp values as GMT, displaying as (client) local?
  • Previous by thread: storing NSTimestamp values as GMT, displaying as (client) local?
  • Next by thread: Re: storing NSTimestamp values as GMT, displaying as (client) local?
  • Index(es):
    • Date
    • Thread