• 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
Re: Date to string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date to string


  • Subject: Re: Date to string
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 28 Nov 2005 10:04:20 +0100

Am 28.11.2005 um 07:17 schrieb JuanC:
The matter is that I need put a static text with the date of today in a window.
The best way sould be with the european format: DD-MM-YY (28 Nov. 2005).

There is no European format. Every country in Europe has their own. E.g. Germany has DD.MM.YY, Great Britain and France have DD/MM/YY (IIRC), etc. I've never seen the one you show here. It looks kind of like a reversed variant of ISO dates, which are YYYY-MM-DD. ISO dates are also the closest you can get to a "European" date (and are used in Sweden).


I don´t know what is the best way: NSDate or NSCalendar... for get the date and NSText or NSTextView... for draw the string.

That's pretty much the two approaches I'd suggest. There's also some sort of date/clock control. Carbon's had it since the Classic days, but I think Apple gave us one for Cocoa a while ago. There's also a bit of sample code (clock control) in your /Developer/Example/ folder somewhere that you may want to have a look at.


I think you can also use an NSDateFormatter with an NSTextField.

Most of this stuff can be set up in Interface Builder without much scripting (except for a setObjectValue: call to set the date you want), so sample code wouldn't be very helpful here. Just fire up Xcode and try it, and come back here if you can't get it working.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ 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: Date to string
      • From: Stéphane Sudre <email@hidden>
References: 
 >Date to string (From: JuanC <email@hidden>)

  • Prev by Date: Re: Tree Data Structure in objc-C?
  • Next by Date: Re: How to Solve the Refreshing Problems of NSOpenGLView Placed in a NSScrollVIew
  • Previous by thread: Date to string
  • Next by thread: Re: Date to string
  • Index(es):
    • Date
    • Thread