org.zkoss.text
Class DateFormats

java.lang.Object
  extended by org.zkoss.text.DateFormats

public class DateFormats
extends java.lang.Object

DateFormat relevant utilities.

Author:
tomyeh

Constructor Summary
DateFormats()
           
 
Method Summary
static java.lang.String format(java.util.Date d, boolean dateOnly)
          Formats a Date object based on the current Locale.
static java.util.Date parse(java.lang.String s)
          Parses a string to a date.
 
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

parse

public static final java.util.Date parse(java.lang.String s)
                                  throws java.text.ParseException
Parses a string to a date. It is smart enough to know whether to use DateFormat.getDateInstance and DateFormat.getDateTimeInstance. It also uses Locales.getCurrent().

Throws:
java.text.ParseException

format

public static final java.lang.String format(java.util.Date d,
                                            boolean dateOnly)
Formats a Date object based on the current Locale.

Parameters:
dateOnly - indicates whether to show only date; false to show both date and time


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo