butler.ext.time
Class DateUtil

java.lang.Object
  extended by butler.ext.time.DateUtil

public class DateUtil
extends java.lang.Object

Author:
Fredrik Bertilsson

Constructor Summary
DateUtil()
           
 
Method Summary
static int getDateDiff(java.util.Date date2, java.util.Date date1)
           
static int getDayOfMonth(java.util.Date date)
           
static int getDayOfWeek(java.util.Date date)
           
static java.util.Date getDiffDay(java.util.Date date, int diff)
           
static int getMonth(java.util.Date date)
           
static java.util.Date getStartOfWeek(java.util.Date date)
           
static TimeOfDay getTimeOfDay(java.util.Date date)
           
static java.lang.String getWeekday(java.util.Date date)
           
static int getYear(java.util.Date date)
           
static java.util.Date round2Day(java.util.Date date)
           
static java.util.Date round2Minute(java.util.Date date)
           
static java.util.Date round2Month(java.util.Date date)
           
static java.util.Date round2Week(java.util.Date date)
           
static java.util.Date setTimeOfDate(java.util.Date date, TimeOfDay time)
           
 
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

round2Day

public static java.util.Date round2Day(java.util.Date date)
                                throws java.lang.Exception
Throws:
java.lang.Exception

round2Minute

public static java.util.Date round2Minute(java.util.Date date)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getDayOfWeek

public static int getDayOfWeek(java.util.Date date)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getWeekday

public static java.lang.String getWeekday(java.util.Date date)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getTimeOfDay

public static TimeOfDay getTimeOfDay(java.util.Date date)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getStartOfWeek

public static java.util.Date getStartOfWeek(java.util.Date date)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getYear

public static int getYear(java.util.Date date)
                   throws java.lang.Exception
Throws:
java.lang.Exception

getMonth

public static int getMonth(java.util.Date date)
                    throws java.lang.Exception
Throws:
java.lang.Exception

getDayOfMonth

public static int getDayOfMonth(java.util.Date date)
                         throws java.lang.Exception
Throws:
java.lang.Exception

getDiffDay

public static java.util.Date getDiffDay(java.util.Date date,
                                        int diff)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getDateDiff

public static int getDateDiff(java.util.Date date2,
                              java.util.Date date1)
                       throws java.lang.Exception
Throws:
java.lang.Exception

setTimeOfDate

public static java.util.Date setTimeOfDate(java.util.Date date,
                                           TimeOfDay time)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

round2Week

public static java.util.Date round2Week(java.util.Date date)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

round2Month

public static java.util.Date round2Month(java.util.Date date)
                                  throws java.lang.Exception
Throws:
java.lang.Exception