Re: Time Question (newbie)
Re: Time Question (newbie)
- Subject: Re: Time Question (newbie)
- From: Tom Gray <email@hidden>
- Date: Mon, 20 Jan 2003 08:49:16 -0500
Jonathan,
OK, I am trying to follow your thoughts. I have the number of seconds
my program has run (an NSTimeInterval which is really just a double)
and I want to format this double as an NSString so I can display it. In
other words I want to take this double representing the time my
application has been up and display it in an hhh:mm format.
I can easily do this with C style routines, but, I am trying to find a
Cocoa method to accomplish this task.
Now, you are suggesting that I look at NSCalendarDate.
Is there a method for converting my NSTimeInterval/double "run time"
into an NSCalendarDate? If I tried to then display it, will it report
something like "01January 0000a.d."
Am I being to literal in reading "Calendar" date?
Anyway, sounds like a cool idea and I will investigate. Remember what I
want to do is to format an NSTimeInterval for display.
On Sunday, Jan 19, 2003, at 20:57 US/Eastern, Jonathan Jackel wrote:
You should check out NSCalendarDate, particularly
years:months:days:hours:minutes:seconds:sinceDate:
Jonathan
On Sunday, January 19, 2003, at 06:48 PM, Tom Gray wrote:
Hi Guys,
As always, thanks!
I am trying to add a cumulative time or running time to my
application. Part of my "pay the shareware fee" nag.
I have seen quite a few "Date" objects in Cocoa but I have not found
a good way to get a cumulative or elapsed time object. (I would like
to display a clock in hhh:mm format or dd:hh:mm format.)
Currently I am noting the date when the application launches and
quits. I get the time interval between the launch and quit (a double
or NSTimeInterval) and save that double in my prefs.
I now want to format and display that elapsed time. I can't seem to
find a Cocoa class that handles elapsed time.
Any ideas?
Tom Gray
-------------
email@hidden
or
email@hidden
_______________________________________________
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.
Tom Gray
-------------
email@hidden
or
email@hidden
_______________________________________________
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.