com.arsdigita.toolbox.ui
Class FormatStandards

java.lang.Object
  extended bycom.arsdigita.toolbox.ui.FormatStandards
All Implemented Interfaces:
Globalized

public class FormatStandards
extends Object
implements Globalized

This class holds methods to support consistent formatting across the system.

Version:
$Revision: #10 $ $Date: 2004/04/07 $, $Id: //core-platform/dev/src/com/arsdigita/toolbox/ui/FormatStandards.java#10 $

Field Summary
 
Fields inherited from interface com.arsdigita.globalization.Globalized
BUNDLE_NAME, DATE_DISPLAY_FORMAT, TIME_DISPLAY_FORMAT, versionId
 
Constructor Summary
FormatStandards()
           
 
Method Summary
static String formatDate(Date d)
          Formats a date value according to formatting standards and localization.
static String formatDateTime(Date d)
          Formats a date and time value according to formatting standards and localization.
static DateFormat getDateFormat()
           
static DateFormat getDateTimeFormat()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatStandards

public FormatStandards()
Method Detail

getDateFormat

public static DateFormat getDateFormat()
Returns:
A globalized DateFormat instance for formatting the date only.
See Also:
getDateTimeFormat()

getDateTimeFormat

public static DateFormat getDateTimeFormat()
Returns:
A globalized DateFormat instance for formatting the date and time.
See Also:
getDateFormat()

formatDate

public static String formatDate(Date d)
Formats a date value according to formatting standards and localization. In English This will show the date as "Mmm DD, YYYY" or "Jan 23, 2002." This method discards the clock time.

Parameters:
d - The date to format.
Returns:
A properly formatted date.
See Also:
formatDateTime(Date)

formatDateTime

public static String formatDateTime(Date d)
Formats a date and time value according to formatting standards and localization. This method includes the date and the time. In English, it will appear as "Mmm DD, YYYY HH:MM AM" or "Jan 23, 2002, 5:44 PM.

Parameters:
d - The date to format.
Returns:
A properly formatted date and time.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC