| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Here is the gist of the problem : 1. You need Java 1.4.2.11 or Java 1.5.0.6 to get the new zone files. 2. If you are using NSTimestamp, you need to not use it for timezone stuff. WO still uses NSTimezone when you pass in a Java TimeZone, and uses its own zone files, which are hopelessly out of date. In our case, we store everything in the db as GMT, and then convert on the fly depending on what zone the user is in. We use the following methods : /** * Returns a new time stamp for the passed in Timezone. * * @param iMillis time stamp to be converted * @param iZone Timzone in which conversion is needed. * @return an NSTimestamp with date converted to iZone. */ public static NSTimestamp changeDateForTimezone(long iMillis, TimeZone iZone) { long anOffset = 0l; if (iZone != null) anOffset = iZone.getOffset(iMillis); return new NSTimestamp(iMillis + anOffset); } public static NSTimestamp changeDateForTimezone(NSTimestamp iTimestamp, TimeZone iZone) { return changeDateForTimezone(iTimestamp.getTime(), iZone); } Hope this helps. On Dec 19, 2006, at 7:06 PM, Dan Faber wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/email@hidden This email sent to email@hidden
| References: | |
| >NSTimestamp problem (From: Dan Faber <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.