• 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: Determining Local Time Formats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining Local Time Formats


  • Subject: Re: Determining Local Time Formats
  • From: Kyle Hammond <email@hidden>
  • Date: Thu, 11 Jul 2002 14:11:15 -0500

Hi Richard,

You can use the following code to determine if the time format is 12 or 24 hour.

BOOL userHas24HourClock( void )
{
NSString *timeFormat;

// Grab the localized time formatting string.
timeFormat = [ [ NSUserDefaults standardUserDefaults ] objectForKey:NSTimeFormatString ];

// %H is the 24 hour time. %I is the 12 hour time.
return ( [ timeFormat rangeOfString:@"%H" options:NSLiteralSearch ].location != NSNotFound );
}

Best regards,
Kyle

Date: Wed, 10 Jul 2002 13:49:45 -0700
Subject: Determining Local Time Formats
From: Richard Schreyer <email@hidden>
To: Cocoa Development List <email@hidden>

I looked through UserDefaults, but I didn't see anything that would tell
me if the user is using a 12/24 hour time format.

Where could I find this?

Richard Schreyer

---------------------
Kyle Hammond
email@hidden

http://www.CodeBlazer.com/ - multimedia software solutions
http://www.isd.net/dsl03002/ - my personal home page
http://cocoabudget.home.att.net/ - Budget for MacOS X home page
_______________________________________________
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.

  • Prev by Date: Re: NSWindow not restoring location
  • Next by Date: Sheets using Cocoa/Java
  • Previous by thread: Determining Local Time Formats
  • Next by thread: deallocating instances instantiated in IB
  • Index(es):
    • Date
    • Thread