Elexis API documentation
Version 2.1.6 as of December 11 2011

de.ralfebert.rcputils.types
Class DateHelper

java.lang.Object
  extended by de.ralfebert.rcputils.types.DateHelper

public class DateHelper
extends java.lang.Object

Helper methods for dealing with java.util.Date


Constructor Summary
DateHelper()
           
 
Method Summary
static java.util.Date addDays(java.util.Date date, int nDays)
          Adds nDays to the given date and returns a new date
static java.util.Date getDateByDayMonthYear(int day, int month, int year)
          This method creates a new Date object with the given date
static java.util.Date getDateWithoutTime(java.util.Date date)
          Returns date without time (hour, minute, second, millisecond set to 0)
static java.util.Date getToday()
          Returns the date representing today (by system time) without time
static java.util.Date getTomorrow()
          Returns the date representing tomorrow (by system time) without time
static boolean isEqualOrAfterTomorrow(java.util.Date d)
          Returns true if the given date equals or is after tomorrow (ignoring the time)
static java.util.Date max(java.util.Date d1, java.util.Date d2)
          Returns the latest date of the given dates
static java.util.Date min(java.util.Date d1, java.util.Date d2)
          Returns the earliest date of the given dates
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateHelper

public DateHelper()
Method Detail

isEqualOrAfterTomorrow

public static boolean isEqualOrAfterTomorrow(java.util.Date d)
Returns true if the given date equals or is after tomorrow (ignoring the time)

Returns:
true if the given date is equals or after tomorrow

getToday

public static java.util.Date getToday()
Returns the date representing today (by system time) without time

Returns:

getTomorrow

public static java.util.Date getTomorrow()
Returns the date representing tomorrow (by system time) without time

Returns:
Date object representing tomorrow 00:00:00

getDateWithoutTime

public static java.util.Date getDateWithoutTime(java.util.Date date)
Returns date without time (hour, minute, second, millisecond set to 0)

Parameters:
date - date
Returns:
date without time

max

public static java.util.Date max(java.util.Date d1,
                                 java.util.Date d2)
Returns the latest date of the given dates

Parameters:
d1 -
d2 -
Returns:
latest date of the given dates

min

public static java.util.Date min(java.util.Date d1,
                                 java.util.Date d2)
Returns the earliest date of the given dates

Parameters:
d1 - date
d2 - date
Returns:
earliest date of the given dates

addDays

public static java.util.Date addDays(java.util.Date date,
                                     int nDays)
Adds nDays to the given date and returns a new date

Parameters:
date - date
nDays - number of days to add
Returns:
date added nDays

getDateByDayMonthYear

public static java.util.Date getDateByDayMonthYear(int day,
                                                   int month,
                                                   int year)
This method creates a new Date object with the given date

Parameters:
day - day of the month 1..31
month - month of the year 1..12
year - year for digits, e.g. 2002
Returns:
a Date based on input parameters (with time zeroed)

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis