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

Re: NSTimestampFormatter and WOString dateformat


  • Subject: Re: NSTimestampFormatter and WOString dateformat
  • From: Q <email@hidden>
  • Date: Mon, 26 Nov 2007 07:02:05 +1000


On 24/11/2007, at 10:04 AM, Lachlan Deck wrote:

On 23/11/2007, at 4:28 PM, Gaastra Dennis - WO Lists wrote:

But how is this helpful if you have been using POSIX formats everywhere; e.g. can the SimpleDateFormat accept those; or do you still need to convert everywhere? Thanks.

Two options:
a) change your POSIX formats everywhere to SimpleDateFormat equivalents.
b) provide a default formatter that converts POSIX style formats to the relevant format.

That's all the NSTimestampFormatter really does, so you may as well keep using that for now if you need POSIX strftime() support.


The deprecation note states it is because it will no longer be improved, not that it is being removed any time soon.

On 22-Nov-07, 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



_______________________________________________
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


  • Follow-Ups:
    • Re: NSTimestampFormatter and WOString dateformat
      • From: Chuck Hill <email@hidden>
References: 
 >NSTimestampFormatter and WOString dateformat (From: Q <email@hidden>)
 >Re: NSTimestampFormatter and WOString dateformat (From: Gaastra Dennis - WO Lists <email@hidden>)
 >Re: NSTimestampFormatter and WOString dateformat (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Xcode 3 - No WebObjects entry in New Project list
  • Next by Date: SQL Generation and FrontBase 4.1.16
  • Previous by thread: Re: NSTimestampFormatter and WOString dateformat
  • Next by thread: Re: NSTimestampFormatter and WOString dateformat
  • Index(es):
    • Date
    • Thread