Re: Carbon Date to NSDate - How?
Re: Carbon Date to NSDate - How?
- Subject: Re: Carbon Date to NSDate - How?
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 25 Feb 2002 14:55:29 -0800
On Monday, February 25, 2002, at 11:20 AM, John Pattenden wrote:
I have a carbon app that sends a ulong date to my cocoa code,
is there a simple way to convert from Carbon's date format to
cocoas??
Depending on just what the epoch is for that unsigned long,
assuming that value is seconds since the epoch, you can do it
like this:
unsigned long carbonDate;
double interval = carbonDate;
NSDate myDate = [NSDate
dateWithTimeIntervalSinceReferenceDate:interval];
or this:
NSDate myDate = [NSDate dateWithTimeIntervalSince1970:interval];
See which one works.
HTH,
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.