• 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: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.


  • Subject: Re: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
  • From: Manish Pattath <email@hidden>
  • Date: Wed, 17 Mar 2004 14:14:58 +0000 (GMT)

Thanks,for pointing me in the right direction Nick.
I got the localized dates depending on the locale.

Nick Zitzmann <email@hidden> wrote:

On Mar 16, 2004, at 7:30 AM, Manish Pattath wrote:

> I get a date from a device in the form of 1077715270
> basically UTCDateTime.
> I need to extract the date and time in Cocoa ,from
> this in a specific format like
> Wed Apr 24,2003 \n 4:22:20 AM

That looks like a time value written in seconds since the Unix epoch.
You might want to try:

NSDate *date = [NSDate dateWithTimeIntevalSince1970:1077715270];

... or whatever variable (in double format) is holding that time.

> Also i need to display this in Localized format
> depending on the locale.

Use NSDateFormatter to do this.

Nick Zitzmann


S/MIME signature available upon request

UNIX: Where /sbin/init is Job #1.

Yahoo! India Promos: Win a trip for 2 to Britain. Click here.
_______________________________________________
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.


  • Follow-Ups:
    • Re: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
      • From: Marco Scheurer <email@hidden>
  • Prev by Date: windowControllerDidLoadNib not called
  • Next by Date: Re: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
  • Previous by thread: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
  • Next by thread: Re: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
  • Index(es):
    • Date
    • Thread