We're basically talking semantics here, but you are correct. NSTimestampFormatter formats the NSTimestamp, and it is responsible for adjusting timestamps to be the local time zone.
Ken On Sep 20, 2006, at 5:10 PM, Robert Walker wrote: The following statement was extracted from the description for NSTimestamp in the API documentation:
NSTimestamp does not maintain time zone information. All NSTimestamps are 64 bit millisecond offsets since the reference date in the reference time zone. This is January 1, 1970, 00:00:00 GMT.
Which makes me wonder about this statement: The NSTimestamp is adjusting for your time zone. I do this at the start of all my WO Apps:
If NSTimestamp does not maintain time zone information then how can it be "adjusting for your time zone?"
I just want to make sure my understanding of this is correct. According to my understanding, of course the time is stored in the database based on GMT time. That seems logical to me, given the behavior of NSTimestamp. This seems to me more related to NSTimestampFormatter class rather than NSTimestamp.
On Sep 20, 2006, at 11:32 AM, Ken Anderson wrote: Amit,
The NSTimestamp is adjusting for your time zone. I do this at the start of all my WO Apps:
TimeZone.setDefault(TimeZone.getTimeZone("GMT")); NSTimeZone.setDefault(TimeZone.getTimeZone("GMT"));
This does a really nice job of keeping all the dates as just dates, and then I adjust for the user's timezone using a formatter.
Ken On Sep 20, 2006, at 11:25 AM, Amit Kejriwal wrote:
Hi All,
I have used The NSTimestamp object (new NSTimestamp) to insert the date time in the database for the time at which the record was entered. But when I retreive those records for the report generation purpose using the rawRow for SQL I get the correct Date . But the time is not what it is there in the database. All the time values get defaulted to 07:00:00 Etc/GMT, what can be the reason? Please advise.
Thanks&Regards Amit _______________________________________________ Do not post admin requests to the list. They will be ignored. Help/Unsubscribe/Update your Subscription:
_______________________________________________ Do not post admin requests to the list. They will be ignored. Help/Unsubscribe/Update your Subscription:
_______________________________________________ Do not post admin requests to the list. They will be ignored. Help/Unsubscribe/Update your Subscription:
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to archive@mail-archive.com