com.codestreet.messageforge
Class RDateFormat
java.lang.Object
com.codestreet.messageforge.RDateFormat
- public class RDateFormat
- extends java.lang.Object
Singleton class for formatting Date fields as ,
and creating Date fields from a .
- Author:
- Jawaid Hakim.
Method Summary |
java.lang.String |
format(java.util.Date date)
Format a date. |
java.lang.String |
format(java.lang.Object date)
Format a date. |
static RDateFormat |
getInstance()
Get singleton instance. |
static java.lang.String |
getPattern()
Get the data format pattern. |
java.util.Date |
parse(java.lang.String strDate)
Parse a string and create a date. |
static void |
setPattern(java.lang.String pattern)
Set the data format pattern. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RDateFormat
protected RDateFormat()
- Ctor.
getInstance
public static RDateFormat getInstance()
- Get singleton instance.
- Returns:
- Singleton instance.
format
public java.lang.String format(java.util.Date date)
- Format a date.
- Parameters:
date
- Date to format.
- Returns:
- Formatted date.
format
public java.lang.String format(java.lang.Object date)
- Format a date.
- Parameters:
date
- Date to format.
- Returns:
- Formatted date.
parse
public java.util.Date parse(java.lang.String strDate)
throws java.text.ParseException
- Parse a string and create a date.
- Parameters:
strDate
- String date.
- Returns:
- Date.
- Throws:
java.text.ParseException
setPattern
public static void setPattern(java.lang.String pattern)
- Set the data format pattern. The defaul date format pattern is based on
the Internet Engineering Task Force (IETF) Request for Comments (RFC)
1123 and is
EEE, d MMM yyyy HH:mm:ss z
.
- Parameters:
pattern
- Date format pattern
getPattern
public static java.lang.String getPattern()
- Get the data format pattern. The defaul date format pattern is based on
the Internet Engineering Task Force (IETF) Request for Comments (RFC)
1123 and is
EEE, d MMM yyyy HH:mm:ss z
.
- Returns:
- Date format pattern
Copyright © 2003-2006 CodeStreet. All Rights Reserved.