Re: Trouble comparing NSCalendarDates
Re: Trouble comparing NSCalendarDates
- Subject: Re: Trouble comparing NSCalendarDates
- From: j o a r <email@hidden>
- Date: Mon, 15 Nov 2004 11:30:05 +0100
On 2004-11-15, at 11.14, Tito Ciuro wrote:
If I call this:
returnedValue = [NSCalendarDate dateWithString: [NSString
stringWithUTF8String: data]];
The proper date is returned... *however*: if you compare both dates,
they're still *not* the same. It seems to me that the original date
created using [NSCalendarDate date] stores sub-
second information. This extra info is not stored to disk, so when we
instantiate a new NSCalendarDate object with the above statement, the
sub-second information has been lost:
If you check the string that you pass to NSCalendarDate, does it
contain the subsecond data that you're interested in?
If it does, perhaps you could retain the sub-second precision if you
use a format string that explicitly includes sub-second precision?
Is there any way I can store/retrieve to disk all the information
belonging to an NSCalendarDate?
How about using these methods from NSDate? You could probably use them
both for comparing and storing values.
+[NSDate dateWithTimeIntervalSinceReferenceDate:]
-[NSDate timeIntervalSinceReferenceDate]
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden