org.jutil
Class TDate

java.lang.Object
  extended by org.jutil.TDate

public final class TDate
extends java.lang.Object

This is the TDate utility code class.


Constructor Summary
TDate()
          Ensure that no one can create instances of this Class.
 
Method Summary
static java.util.Date create(long time)
           
static java.util.Date create(java.lang.Long time)
           
static java.util.Set dateRange(java.util.Date startDate, java.util.Date endDate)
           
static java.util.Set dateRange(java.util.Date startDate, int count)
           
static java.util.Set dateRange(long time, int count)
           
static java.util.Date decrementDay(java.util.Date start, int count)
           
static java.util.Date decrementDay(long time, int count)
           
static java.util.Date decrementMonth(java.util.Date start, int count)
           
static java.util.Date decrementMonth(long time, int count)
           
static java.util.Date decrementWeek(java.util.Date start, int count)
           
static java.util.Date decrementWeek(long time, int count)
           
static java.lang.String format(java.util.Date date)
          USAGE: org.jutil.TDate.format(java.util.Date date);
static java.lang.String format(java.util.Date date, java.util.Locale locale)
          USAGE: org.jutil.TDate.format(java.util.Date date, java.util.Locale locale);
static java.lang.String format(long time)
          USAGE: org.jutil.TDate.format(long time);
static java.lang.String format(long time, java.util.Locale locale)
          USAGE: org.jutil.TDate.format(long time, java.util.Locale locale);
static java.util.Date getDate()
          USAGE: org.jutil.TDate.getDate();
static java.lang.String getJDBCFormat()
          JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.getJDBCFormat();
static java.lang.String getJDBCFormat(java.util.Date date)
          JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.getJDBCFormat(java.util.Date date);
static java.lang.String getJDBCFormat(long time)
          JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.getJDBCFormat(long time);
static java.lang.String getRFC822Format(java.util.Date date)
          USAGE: org.jutil.TDate.getRFC822Format(java.util.Date date); "EEE, d MMM yyyy HH:mm:ss" Wed, 4 Jul 2001 12:08:56
static java.util.Date incrementDay(java.util.Date start, int count)
           
static java.util.Date incrementDay(long time, int count)
           
static java.util.Date incrementMonth(java.util.Date start, int count)
           
static java.util.Date incrementMonth(long time, int count)
           
static java.util.Date incrementWeek(java.util.Date start, int count)
           
static java.util.Date incrementWeek(long time, int count)
           
static boolean isDateInRange(java.util.Date test, java.util.Date startDate, java.util.Date endDate)
           
static java.sql.Date jdbcFormatToDate(java.lang.String value)
          JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.jdbcFormatToDate(String jdbcDate);
static java.util.Calendar parseJDBCFormatString(java.lang.String value)
          USAGE: Calendar cal = TDate.parseJDBCFormatString(String jdbcDate);
static java.lang.String toSimpleDateFormat(java.util.Date date, java.lang.String format)
          USAGE: org.jutil.TDate.toSimpleDateFormat(long time, final String format); org.jutil.TDate.toSimpleDateFormat(new Date(), "dd mm yyyy");
static java.util.Collection weekRange(java.util.Date startDate)
          give it a date an return an array of dates mon-sun that the date is in assumes week starts on mon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TDate

public TDate()
Ensure that no one can create instances of this Class.

Method Detail

getDate

public static final java.util.Date getDate()
USAGE: org.jutil.TDate.getDate();


create

public static final java.util.Date create(long time)

create

public static final java.util.Date create(java.lang.Long time)

toSimpleDateFormat

public static final java.lang.String toSimpleDateFormat(java.util.Date date,
                                                        java.lang.String format)
USAGE: org.jutil.TDate.toSimpleDateFormat(long time, final String format); org.jutil.TDate.toSimpleDateFormat(new Date(), "dd mm yyyy");


getJDBCFormat

public static final java.lang.String getJDBCFormat(java.util.Date date)
JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.getJDBCFormat(java.util.Date date);


getJDBCFormat

public static final java.lang.String getJDBCFormat(long time)
JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.getJDBCFormat(long time);


getJDBCFormat

public static final java.lang.String getJDBCFormat()
JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.getJDBCFormat();


jdbcFormatToDate

public static final java.sql.Date jdbcFormatToDate(java.lang.String value)
JDBCFormat = yyyy-mm-dd USAGE: org.jutil.TDate.jdbcFormatToDate(String jdbcDate);


parseJDBCFormatString

public static final java.util.Calendar parseJDBCFormatString(java.lang.String value)
                                                      throws java.lang.IndexOutOfBoundsException,
                                                             java.lang.IllegalArgumentException
USAGE: Calendar cal = TDate.parseJDBCFormatString(String jdbcDate);

Parameters:
value - String JDBCFormat = yyyy-mm-dd
Returns:
java.util.Calendar
Throws:
java.lang.IndexOutOfBoundsException
java.lang.IllegalArgumentException

format

public static final java.lang.String format(long time)
USAGE: org.jutil.TDate.format(long time);


format

public static final java.lang.String format(long time,
                                            java.util.Locale locale)
USAGE: org.jutil.TDate.format(long time, java.util.Locale locale);


format

public static final java.lang.String format(java.util.Date date)
USAGE: org.jutil.TDate.format(java.util.Date date);


format

public static final java.lang.String format(java.util.Date date,
                                            java.util.Locale locale)
USAGE: org.jutil.TDate.format(java.util.Date date, java.util.Locale locale);


getRFC822Format

public static final java.lang.String getRFC822Format(java.util.Date date)
USAGE: org.jutil.TDate.getRFC822Format(java.util.Date date); "EEE, d MMM yyyy HH:mm:ss" Wed, 4 Jul 2001 12:08:56


weekRange

public static final java.util.Collection weekRange(java.util.Date startDate)
give it a date an return an array of dates mon-sun that the date is in assumes week starts on mon


isDateInRange

public static final boolean isDateInRange(java.util.Date test,
                                          java.util.Date startDate,
                                          java.util.Date endDate)

dateRange

public static final java.util.Set dateRange(long time,
                                            int count)

dateRange

public static final java.util.Set dateRange(java.util.Date startDate,
                                            int count)

dateRange

public static final java.util.Set dateRange(java.util.Date startDate,
                                            java.util.Date endDate)

incrementDay

public static final java.util.Date incrementDay(long time,
                                                int count)

incrementDay

public static final java.util.Date incrementDay(java.util.Date start,
                                                int count)

incrementWeek

public static final java.util.Date incrementWeek(long time,
                                                 int count)

incrementWeek

public static final java.util.Date incrementWeek(java.util.Date start,
                                                 int count)

incrementMonth

public static final java.util.Date incrementMonth(long time,
                                                  int count)

incrementMonth

public static final java.util.Date incrementMonth(java.util.Date start,
                                                  int count)

decrementDay

public static final java.util.Date decrementDay(long time,
                                                int count)

decrementDay

public static final java.util.Date decrementDay(java.util.Date start,
                                                int count)

decrementWeek

public static final java.util.Date decrementWeek(long time,
                                                 int count)

decrementWeek

public static final java.util.Date decrementWeek(java.util.Date start,
                                                 int count)

decrementMonth

public static final java.util.Date decrementMonth(long time,
                                                  int count)

decrementMonth

public static final java.util.Date decrementMonth(java.util.Date start,
                                                  int count)