Joda Time API

org.joda.time.format
Class DateTimeFormat

java.lang.Object
  |
  +--org.joda.time.format.DateTimeFormat

public class DateTimeFormat
extends java.lang.Object

DateTimeFormat provides localized printing and parsing capabilities for all dates and times.

Author:
Brian S O'Neill
See Also:
ISODateTimeFormat, DateTimeFormatterBuilder

Method Summary
 DateTimeFormatter forPattern(java.lang.String pattern)
          Select a format from a custom pattern.
 DateTimeFormatter forStyle(java.lang.String style)
          Select a format from a two character style pattern.
static DateTimeFormat getInstance()
           
static DateTimeFormat getInstance(Chronology chrono)
           
static DateTimeFormat getInstance(Chronology chrono, java.util.Locale locale)
           
static DateTimeFormat getInstance(DateTimeZone zone)
           
static DateTimeFormat getInstance(DateTimeZone zone, java.util.Locale locale)
           
static DateTimeFormat getInstanceUTC()
           
 java.lang.String getPatternForStyle(java.lang.String style)
          Returns a pattern specification from a two character style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstanceUTC

public static DateTimeFormat getInstanceUTC()

getInstance

public static DateTimeFormat getInstance()

getInstance

public static DateTimeFormat getInstance(DateTimeZone zone)

getInstance

public static DateTimeFormat getInstance(DateTimeZone zone,
                                         java.util.Locale locale)

getInstance

public static DateTimeFormat getInstance(Chronology chrono)
Parameters:
chrono - Chronology to use

getInstance

public static DateTimeFormat getInstance(Chronology chrono,
                                         java.util.Locale locale)
Parameters:
chrono - Chronology to use
locale - Locale to use

forPattern

public DateTimeFormatter forPattern(java.lang.String pattern)
Select a format from a custom pattern.

Parameters:
pattern - pattern specification
Throws:
java.lang.IllegalArgumentException
See Also:
DateTimeFormatterBuilder.appendPattern(java.lang.String)

forStyle

public DateTimeFormatter forStyle(java.lang.String style)
Select a format from a two character style pattern. The first character is the date style, and the second character is the time style. Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full. A date or time may be ommitted by specifying a style character '-'.

Parameters:
style - two characters from the set {"S", "M", "L", "F", "-"}
Throws:
java.lang.IllegalArgumentException

getPatternForStyle

public java.lang.String getPatternForStyle(java.lang.String style)
Returns a pattern specification from a two character style. The first character is the date style, and the second character is the time style. Specify a character of 'S' for short style, 'M' for medium, 'L' for long, and 'F' for full. A date or time may be ommitted by specifying a style character '-'.

Parameters:
style - two characters from the set {"S", "M", "L", "F", "-"}
Throws:
java.lang.IllegalArgumentException

Joda Time API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.