ca.infoway.messagebuilder.j5goodies
Class DateUtil

Package class diagram package DateUtil
java.lang.Object
  extended by ca.infoway.messagebuilder.j5goodies.DateUtil

public class DateUtil
extends Object

A class that provides some utilities for date manipulation.

Author:
Intelliware Development

Constructor Summary
DateUtil()
           
 
Method Summary
static Date getDate(int year, int zeroBasedMonth, int day)
          Construct a date.
static Date getDate(int year, int zeroBasedMonth, int day, int hour, int minute, int second, int subsecond)
          Construct a date.
static Date getDate(int year, int zeroBasedMonth, int day, int hour, int minute, int second, int subsecond, TimeZone timeZone)
           
static Date getEndOf(Date date)
          Get the very last millisecond of the day.
static Date getStartOf(Date date)
          Get the very first millisecond of the day.
static DateFormat instance(String pattern)
          Get a date format instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtil

public DateUtil()
Method Detail

instance

public static DateFormat instance(String pattern)

Get a date format instance. This method ensures that the instance is local to a thread, to compensate for the fact that DateFormats aren't thread-safe.

Parameters:
pattern - - the date format pattern.
Returns:
- the Date format.

getDate

public static Date getDate(int year,
                           int zeroBasedMonth,
                           int day)

Construct a date.

Parameters:
year - - the year
zeroBasedMonth - - the month (e.g. Calendar.JANUARY)
day - - the day of the month
Returns:
- the date.

getDate

public static Date getDate(int year,
                           int zeroBasedMonth,
                           int day,
                           int hour,
                           int minute,
                           int second,
                           int subsecond)

Construct a date.

Parameters:
year - - the year
zeroBasedMonth - - the month (e.g. Calendar.JANUARY)
day - - the day of the month
hour - - the hour in 24-hour notation
minute - - the minute
second - - the second
subsecond - TODO
Returns:
- the date.

getDate

public static Date getDate(int year,
                           int zeroBasedMonth,
                           int day,
                           int hour,
                           int minute,
                           int second,
                           int subsecond,
                           TimeZone timeZone)

getEndOf

public static Date getEndOf(Date date)

Get the very last millisecond of the day.

Parameters:
date - - the day
Returns:
- the last millisecond of the day.

getStartOf

public static Date getStartOf(Date date)

Get the very first millisecond of the day.

Parameters:
date - - the day
Returns:
- the first millisecond of the day.


Copyright © 2013. All Rights Reserved.