Two questions about NSCalendarDate
Two questions about NSCalendarDate
- Subject: Two questions about NSCalendarDate
- From: Ben Borofka <email@hidden>
- Date: Wed, 16 Mar 2005 21:22:58 -0800
I'm using
NSCalendarDate to get an
NSString timestamp for my app. I have two separate questions.
First of all, I'd like to be able to use my
NSCalendarDate instance to seed a random number generator.
srandom() only takes an
int as its argument, and I'm not sure the best way to get an
int value from my
NSCalendarDate. I've tried taking the
NSString value of it, then converting that to an
int, but it doesn't seem to be working very well. There is probably a much easier solution to this that I don't know about. Anyone have any ideas?
Secondly, I want to set the timestamp format to use
%m,
%d and
%H without leading zeros. For example, I want:
1/4/2005 2:45 PM
instead of:
01/04/2005 02:45 PM
Is there an easy way to do this?
Thanks.
Ben
_______________________________________________
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