NSTimestampFormatter and WOString dateformat

64 views
Skip to first unread message

Q

unread,
Nov 22, 2007, 10:57:59 PM11/22/07
to wotips, WebObjects-Dev List
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 - qdo...@gmail.com

Gold Coast, QLD, Australia (GMT+10)

Ph: +61 419 729 806




Reply all
Reply to author
Forward
0 new messages