Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Getting Started With WebObjects


   

Setting a Date Format

To change the way that dates are displayed, you assign a date format to the element that displays the dates.

  1. Using WebObjects Builder, inspect the dateReleased text field, which is near the bottom of the Main component window.

    Notice that the text field has a dateformat attribute that is bound to the string "%m/%d/%y". This binding tells the text field that it's displaying dates and describes how to format them. The %m conversion specifier stands for month as a decimal number, %d stands for day of the month, and %y stands for year without century.

  2. Click the combo box on the right side of the binding column. Choose "%d %B %Y".

    This date format displays dates as 14 Jan 2005. The %b conversion specifier stands for abbreviated month name, and %Y stands for year with century. You can create your own date formats with any of the conversion specifiers defined for dates. For more information, see the NSGregorianDate class specification in the Foundation Framework Reference.


© 1999 Apple Computer, Inc. – (Last Updated 24 Aug 99)