SPT Core API

com.sptci.util
Class DateUtilities

java.lang.Object
  extended by com.sptci.util.DateUtilities

public final class DateUtilities
extends Object

Utility class that provides convenience methods for performing common date routines.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: DateUtilities.java 4557 2009-01-01 13:31:36Z rakesh $
Author:
Rakesh 2008-12-24

Method Summary
static Date getCurrentDay()
          Return a date instance that represents the current day in the local time zone.
static Date getCurrentDay(TimeZone timeZone)
          Return a date instance that represents the current day in the specified time zone.
static Date getCurrentDayEnd()
          Return a date instance that represents the current day in the local time zone.
static Date getCurrentDayEnd(TimeZone timeZone)
          Return a date instance that represents the current day in the specified time zone.
static Date getDay(Date date)
          Return the day after truncating the time component from the specified date for the default time zone.
static Date getDay(Date date, TimeZone timeZone)
          Return the day after truncating the time component from the specified date for the specified time zone.
static Date getDayEnd(Date date)
          Return the day after truncating the time component from the specified date for the default time zone.
static Date getDayEnd(Date date, TimeZone timeZone)
          Return the day after truncating the time component from the specified date for the specified time zone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentDay

public static Date getCurrentDay()
Return a date instance that represents the current day in the local time zone.

Returns:
The current day.
See Also:
getCurrentDay(java.util.TimeZone)

getCurrentDay

public static Date getCurrentDay(TimeZone timeZone)
Return a date instance that represents the current day in the specified time zone.

Parameters:
timeZone - The time zone to use to compute the day.
Returns:
The current day.
See Also:
CalendarUtilities.getCurrentDay(java.util.TimeZone)

getCurrentDayEnd

public static Date getCurrentDayEnd()
Return a date instance that represents the current day in the local time zone.

Returns:
The current day.
See Also:
getCurrentDayEnd(java.util.TimeZone)

getCurrentDayEnd

public static Date getCurrentDayEnd(TimeZone timeZone)
Return a date instance that represents the current day in the specified time zone.

Parameters:
timeZone - The time zone to use to compute the day.
Returns:
The current day.
See Also:
CalendarUtilities.getCurrentDayEnd(java.util.TimeZone)

getDay

public static Date getDay(Date date)
Return the day after truncating the time component from the specified date for the default time zone.

Parameters:
date - The date whose time component is to be truncated.
Returns:
The date that represents the day for the specified date.
See Also:
getDay(java.util.Date, java.util.TimeZone)

getDay

public static Date getDay(Date date,
                          TimeZone timeZone)
Return the day after truncating the time component from the specified date for the specified time zone.

Parameters:
date - The date whose time component is to be truncated.
timeZone - The time zone to base the correction on.
Returns:
The date that represents the day for the specified date.
See Also:
CalendarUtilities.getDay(java.util.Date, java.util.TimeZone)

getDayEnd

public static Date getDayEnd(Date date)
Return the day after truncating the time component from the specified date for the default time zone.

Parameters:
date - The date whose time component is to be truncated.
Returns:
The date that represents the day for the specified date.
See Also:
getDayEnd(java.util.Date, java.util.TimeZone)

getDayEnd

public static Date getDayEnd(Date date,
                             TimeZone timeZone)
Return the day after truncating the time component from the specified date for the specified time zone.

Parameters:
date - The date whose time component is to be truncated.
timeZone - The time zone to base the correction on.
Returns:
The date that represents the day for the specified date.
See Also:
CalendarUtilities.getDayEnd(java.util.Date, java.util.TimeZone)

SPT Core API