• 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: [wotips] NSTimestampFormatter and WOString dateformat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [wotips] NSTimestampFormatter and WOString dateformat


  • Subject: Re: [wotips] NSTimestampFormatter and WOString dateformat
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 22 Nov 2007 20:39:09 -0800

One thing I have been thinking about is that SimpleDateFormat is documented to NOT be thread safe. NSTimestampFormatter has no such documentation. Is has been my habit for some years now to hold formatter instances at the application level (e.g. for bindings like formatter = application.formatters.longDateFormatter; where formatters is an NSDictionary in Application). If NSTimestampFormatter is not thread safe, I at least have not noticed it. I _haven't_ used them in a localized setting.

If you have been doing a similar thing, this is something to be aware of.

Chuck

On Nov 22, 2007, at 7:57 PM, Q wrote:

With NSTimestampFormatter being deprecated in WO 5.4, and the recommended alternative being to use SimpleDateFormat, there is the slightly annoying matter of WOString's dateformat binding taking a POSIX strftime() style date format string, and SimpleDateFormat using ISO format datetime format. Or so I originally though.

Much to my surprise, NSTimestampFormatter has this little gem of information in the documentation:

Alternatively, you can specify the pattern using Sun's date pattern specifiers. See Sun's documentation for the java.text.SimpleDateFormat class for more information.

Ie. You can use the ISO datetime format that SimpleDateFormat uses in your dateformat binding.

So the following WOString bindings both do the same thing:

dateformat = "%a %d %b %Y";
dateformat = "EEE dd MMM yyyy";

Note to self: Sometimes it helps to read ALL the documentation.

--
Seeya...Q

Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806



--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTimestampFormatter and WOString dateformat (From: Q <email@hidden>)

  • Prev by Date: NSTimestampFormatter and WOString dateformat
  • Next by Date: Re: NSTimestampFormatter and WOString dateformat
  • Previous by thread: NSTimestampFormatter and WOString dateformat
  • Next by thread: Re: NSTimestampFormatter and WOString dateformat
  • Index(es):
    • Date
    • Thread