• 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: Obtain an NSDate object from any casually entered user string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtain an NSDate object from any casually entered user string


  • Subject: Re: Obtain an NSDate object from any casually entered user string
  • From: Charles Srstka <email@hidden>
  • Date: Thu, 15 May 2014 08:12:12 -0500

On May 15, 2014, at 8:03 AM, Gerriet M. Denkmann <email@hidden> wrote:

> I always use a 24-hour clock.

Your users may not, though. In the US, at least, 24-hour clocks are definitely a minority.

> Is there a way, to make NSDataDetector aware of this fact? Some options I might set?

NSDataDetector doesn't appear to have any options at *all.*

I suppose you could do stuff like postpend "AM" to the string if the hour is less than 12, and "PM" if it's equal to 12, before running the string through NSDataDetector. The amount of string manipulation you'd have to do might defeat the purpose of using NSDataDetector, though.

Charles

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Re: Obtain an NSDate object from any casually entered user string (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Obtain an NSDate object from any casually entered user string (From: Charles Srstka <email@hidden>)
 >Re: Obtain an NSDate object from any casually entered user string (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Obtain an NSDate object from any casually entered user string
  • Next by Date: DNS Lookup
  • Previous by thread: Re: Obtain an NSDate object from any casually entered user string
  • Next by thread: Re: Obtain an NSDate object from any casually entered user string
  • Index(es):
    • Date
    • Thread