com.evanmclean.evlib.util
Class CalUtils

java.lang.Object
  extended by com.evanmclean.evlib.util.CalUtils

public final class CalUtils
extends Object

Misc utilities for handling Calendar objects.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Method Summary
static void setMidday(Calendar cal)
          Set the time component of the calendar to midday.
static void setMidday(Date dt)
          Set the time component of the date to midday, using the local time zone.
static void setMidday(Date dt, TimeZone tz)
          Set the time component of the date to midday.
static void setMidnight(Calendar cal)
          Set the time component of the calendar to midnight.
static void setMidnight(Date dt)
          Set the time component of the date to midnight, using the local time zone.
static void setMidnight(Date dt, TimeZone tz)
          Set the time component of the date to midnight.
static Date today()
          Return a date, set to midnight of the current local day.
static Date today(TimeZone tz)
          Return a date, set to midnight of the current day for the given time zone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

today

public static Date today()
Return a date, set to midnight of the current local day.

Returns:
Return a date, set to midnight of the current local day.

today

public static Date today(TimeZone tz)
Return a date, set to midnight of the current day for the given time zone.

Parameters:
tz -
Returns:
Return a date, set to midnight of the current day for the given time zone.

setMidday

public static void setMidday(Calendar cal)
Set the time component of the calendar to midday.

Parameters:
cal -

setMidday

public static void setMidday(Date dt)
Set the time component of the date to midday, using the local time zone.

Parameters:
dt -

setMidday

public static void setMidday(Date dt,
                             TimeZone tz)
Set the time component of the date to midday.

Parameters:
dt -
tz -

setMidnight

public static void setMidnight(Calendar cal)
Set the time component of the calendar to midnight.

Parameters:
cal -

setMidnight

public static void setMidnight(Date dt)
Set the time component of the date to midnight, using the local time zone.

Parameters:
dt -

setMidnight

public static void setMidnight(Date dt,
                               TimeZone tz)
Set the time component of the date to midnight.

Parameters:
dt -
tz -