org.mmbase.util
Class DateFormats

java.lang.Object
  extended by org.mmbase.util.DateFormats

public class DateFormats
extends Object

Utility function to create DateFormat instances.

Since:
MMBase-1.7.1
Version:
$Id: DateFormats.java 41055 2010-02-15 23:59:16Z michiel $
Author:
Michiel Meeuwissen

Nested Class Summary
protected static class DateFormats.DayOfWeekDateFormat
          There is no DateFormat which can return the day of the week as a number available in java.text package.
 
Constructor Summary
DateFormats()
           
 
Method Summary
static DateFormat getInstance(String format, String timeZone, Locale locale)
          Creates a DateFormat instance, based on a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFormats

public DateFormats()
Method Detail

getInstance

public static DateFormat getInstance(String format,
                                     String timeZone,
                                     Locale locale)
Creates a DateFormat instance, based on a String.

Parameters:
format - The format defining the DateFormat. This can be constants like :FULL, :FULL.FULL, :LONG, :MEDIUM or :SHORT. It can also be 'e' for weekday. Also 'RFC822' or 'rfc822' is possible then the quite complicated http://www.faqs.org/rfcs/rfc822.html compliant date and time is made, which comes in handy when you need to create a rss feed f.e. Or none of those, then a SimpleDateFormat is instantiated.
timeZone - A String describing the timeZone (see DateFormat#setTimeZone)
locale - Most DateFormat's need a Locale too.
Throws:
IllegalArgumentException


MMBase 2.0-SNAPSHOT - null