• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Two questions about NSCalendarDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Two questions about NSCalendarDate
      • From: Jeremy Dronfield <email@hidden>
    • Re: Two questions about NSCalendarDate
      • From: Magnus Strand <email@hidden>
  • Prev by Date: Open MyDocument from MainMenu
  • Next by Date: Re: When is the 'Open Recent' submenu populated?
  • Previous by thread: Re: Open MyDocument from MainMenu
  • Next by thread: Re: Two questions about NSCalendarDate
  • Index(es):
    • Date
    • Thread