|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.ac.ua.broker.utils.DateUtility
public class DateUtility
This class contains some date utilities needed in the application.
Nested Class Summary | |
---|---|
static class |
DateUtility.WeekDateFormat
This class represents a DateFormatter that returns the week number of the date to format. |
Field Summary | |
---|---|
static long |
HOURINMILLISECONDS
Representation of an hour in milliseconds |
Constructor Summary | |
---|---|
DateUtility()
|
Method Summary | |
---|---|
static java.lang.String |
dateToString(java.util.Date date)
Transform a date object to the string representation. |
static java.util.Date |
earliestDateOfTheWeek(java.util.Date dateObj)
Return the earliest date that lies in the same week as the given date |
static java.lang.String |
getDayofTheDate(java.util.Date d)
Getter for the day of the given date |
static double |
getDoubleNumberOfHoursBetween(java.util.Date startDate,
java.util.Date endDate)
Getter for the double representation of the number of hours between a given start and end date |
static int |
getNumberOfHoursBetween(java.util.Date startDate,
java.util.Date endDate)
Getter for the number of hours between a given start and end date |
static int |
getNumberOfMinutesBetween(java.util.Date startDate,
java.util.Date endDate)
Getter for the number of minutes between a given start and end date |
static int |
getWeekOfTheYear(java.util.Date date)
Getter for the week number in the year in which the given date has place |
static java.util.Date |
toDate(java.lang.String date)
Convert the given string representation of a date to the actual date object using the date formatter |
static java.lang.String |
toTime(java.util.Date date)
Convert the given date to a string that represents the time of the date |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static long HOURINMILLISECONDS
Constructor Detail |
---|
public DateUtility()
Method Detail |
---|
public static int getWeekOfTheYear(java.util.Date date)
date
- the date to return the week number for
public static java.lang.String getDayofTheDate(java.util.Date d)
d
- the date to return the day of
public static java.util.Date toDate(java.lang.String date)
date
- the string representation of the date
public static java.lang.String toTime(java.util.Date date)
date
- the date to return the string representation of the time for
public static java.util.Date earliestDateOfTheWeek(java.util.Date dateObj)
dateObj
- the date for which we have to determine the earliest date that
lies in the same week as this date
public static int getNumberOfHoursBetween(java.util.Date startDate, java.util.Date endDate)
startDate
- the lower boundary of the time intervalendDate
- the upper boundary of the time interval
public static double getDoubleNumberOfHoursBetween(java.util.Date startDate, java.util.Date endDate)
startDate
- the lower boundary of the time intervalendDate
- the upper boundary of the time interval
public static int getNumberOfMinutesBetween(java.util.Date startDate, java.util.Date endDate)
startDate
- the lower boundary of the time intervalendDate
- the upper boundary of the time interval
public static java.lang.String dateToString(java.util.Date date)
date
- the date to transform
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |