Main Page | Packages | Class Tree | Index | Help

xp.util

class DateFormat

Object
  |
  +--xp.util.DateFormat


class DateFormat
extends Object

Date formatting


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public static
DEFAULT: Number
Constant for default style pattern

public static
FULL: Number
Constant for full style pattern

public static
LONG: Number
Constant for long style pattern.

public static
MEDIUM: Number
Constant for medium style pattern

public static
NONE: Number
Constant for no specified style pattern

public static
SHORT: Number
Constant for short style pattern

Constructor

public
DateFormat ( )
Constructs a DateFormat using the given pattern and the default date format symbols for the given locale.

Method Summary

public
applyPattern ( pattern: String )
Applies the given pattern string to this date format

public
format ( value: Date ): String
Formats a Date into a date/time string

public static
getDateInstance ( style: Number, aLocale: Locale )
Gets the date formatter with the given formatting style for the given locale

public static
getDateTimeInstance ( dateStyle: Number, timeStyle: Number, aLocale: Locale )
Gets the date/time formatter with the given formatting styles for the given locale

public static
getInstance ( )
Gets the date formatter with the given formatting style for the given locale.

public static
getTimeInstance ( style: Number, aLocale: Locale )
Gets the date formatter with the given formatting style for the given locale.

public
parse ( value: String ): Date
Parses text from the beginning of the given string to produce a date



Field Documentation

DEFAULT

public static var DEFAULT: Number
Constant for default style pattern

FULL

public static var FULL: Number
Constant for full style pattern

LONG

public static var LONG: Number
Constant for long style pattern.

MEDIUM

public static var MEDIUM: Number
Constant for medium style pattern

NONE

public static var NONE: Number
Constant for no specified style pattern

SHORT

public static var SHORT: Number
Constant for short style pattern


Constructor Documentation

DateFormat

public function DateFormat()
Constructs a DateFormat using the given pattern and the default date format symbols for the given locale.

Constructs a DateFormat using the given pattern and date format symbols. Takes a variety of signatures DateFormat() Constructs a DateFormat using the default pattern and date format symbols for the default locale. DateFormat(pattern:String) Constructs a DateFormat using the given pattern and the default date format symbols for the default locale. DateFormat(pattern:String, formatSymbols:DateSymbols) Constructs a DateFormat using the given pattern and date format symbols. DateFormat(pattern:String, locale:Locale) Constructs a DateFormat using the given pattern and the default date format symbols for the given locale.


Method Documentation

applyPattern

public function applyPattern(pattern: String)
Applies the given pattern string to this date format

Applies the given pattern string to this date format.

Parameters:
pattern
- the new date and time pattern for this date format

format

public function format(value: Date): String
Formats a Date into a date/time string

- Formats a Date into a date/time string

Parameters:
value
- the time value to be formatted into a time string.
Returns:
the formatted time string.

getDateInstance

public static function getDateInstance(style: Number,
 aLocale: Locale)
Gets the date formatter with the given formatting style for the given locale

Gets the date formatter with the given formatting style for the given locale.

Parameters:
style
- the given formatting style. For example, SHORT for "M/d/yy" in the US locale.
aLocale
- the given locale,if a locale is not specified uses the default locale
Returns:
a date formatter

getDateTimeInstance

public static function getDateTimeInstance(dateStyle: Number,
 timeStyle: Number,
 aLocale: Locale)
Gets the date/time formatter with the given formatting styles for the given locale

Gets the date/time formatter with the given formatting styles for the given locale

Parameters:
dateStyle
- the given date formatting style
timeStyle
- the given time formatting style
aLocale
- the given locale, if a locale is not specified uses the default locale
Returns:
a date/time formatter

getInstance

public static function getInstance()
Gets the date formatter with the given formatting style for the given locale.

Get a default date/time formatter that uses the SHORT style for both the date and the time

Returns:
a date formatter

getTimeInstance

public static function getTimeInstance(style: Number,
 aLocale: Locale)
Gets the date formatter with the given formatting style for the given locale.

Gets the date formatter with the given formatting style for the given locale.

Parameters:
style
- the given formatting style. For example, SHORT for "M/d/yy" in the US locale.
aLocale
- the given locale,if a locale is not specified uses the default locale
Returns:
a date formatter

parse

public function parse(value: String): Date
Parses text from the beginning of the given string to produce a date

- Parses text from the beginning of the given string to produce a date. The method may not use the entire text of the given string.

Parameters:
value
- A String whose beginning should be parsed
Returns:
A Date parsed from the string


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc