SPT Core API

com.sptci.util
Class CalendarUtilities

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

public final class CalendarUtilities
extends Object

A utility class that provides convenience methods for common calendar routines.

© Copyright 2008 Sans Pareil Technologies, Inc.

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

Method Summary
static Calendar getCurrentDay()
          Return a calendar instance that represents the current day in the default time zone.
static Calendar getCurrentDay(TimeZone timeZone)
          Return a calendar instance that represents the current day in the specified time zone.
static Calendar getCurrentDayEnd()
          Return a calendar instance that represents the end of the current day in the default time zone.
static Calendar getCurrentDayEnd(TimeZone timeZone)
          Return a calendar instance that represents the end of the current day in the specified time zone.
static Calendar getDay(Date date)
          Return a calendar instance that represents the day specified by the specified date in the default time zone.
static Calendar getDay(Date date, TimeZone timeZone)
          Return a calendar instance that represents the day specified by the specified date in the specified time zone.
static Calendar getDayEnd(Date date)
          Return a calendar instance that represents the end of the day specified by the specified date in the default time zone.
static Calendar getDayEnd(Date date, TimeZone timeZone)
          Return a calendar instance that represents the end of the day specified by the specified date in 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 Calendar getCurrentDay()
Return a calendar instance that represents the current day in the default time zone.

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

getCurrentDay

public static Calendar getCurrentDay(TimeZone timeZone)
Return a calendar 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.

getCurrentDayEnd

public static Calendar getCurrentDayEnd()
Return a calendar instance that represents the end of the current day in the default time zone.

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

getCurrentDayEnd

public static Calendar getCurrentDayEnd(TimeZone timeZone)
Return a calendar instance that represents the end of the current day in the specified time zone.

Parameters:
timeZone - The time zone to use to compute the day.
Returns:
The current day.

getDay

public static Calendar getDay(Date date)
Return a calendar instance that represents the day specified by the specified date in the default time zone.

Parameters:
date - The date from which the day is to be derived.
Returns:
The calendar instance.
See Also:
getDay(java.util.Date, java.util.TimeZone)

getDay

public static Calendar getDay(Date date,
                              TimeZone timeZone)
Return a calendar instance that represents the day specified by the specified date in the specified time zone.

Parameters:
date - The date from which the day is to be derived.
timeZone - The time zone to use to truncate the time.
Returns:
The calendar instance.

getDayEnd

public static Calendar getDayEnd(Date date)
Return a calendar instance that represents the end of the day specified by the specified date in the default time zone.

Parameters:
date - The date from which the day is to be derived.
Returns:
The calendar instance.
See Also:
getDayEnd(java.util.Date, java.util.TimeZone)

getDayEnd

public static Calendar getDayEnd(Date date,
                                 TimeZone timeZone)
Return a calendar instance that represents the end of the day specified by the specified date in the specified time zone.

Parameters:
date - The date from which the day is to be derived.
timeZone - The time zone to use to promote the time.
Returns:
The calendar instance.

SPT Core API