|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.DateSupport
Some routines to support dates better
The problem that generally occurs is with timezones. Therefore, we have made the following structure:
| Constructor Summary | |
DateSupport()
Deprecated. |
|
| Method Summary | |
static String |
colontime(String time)
Deprecated. Puts a colon between a time of RFC-1223 format |
static long |
convertDateToLong(String date)
Deprecated. Convert a string (like "12:42:15 1/2/97") to milliseconds from 1970 The timezone used is 'GMT' |
static long |
currentTimeMillis()
Deprecated. Return the current time in milliseconds (for the current-timezone!!) |
static Date |
Date(int year,
int week,
int day)
Deprecated. Return a date, based on a year, a week and the day of that week For instance: 1999, 40, 4 = The 4th day of the 40th week of 1999 |
static String |
date2date(int time)
Deprecated. Return a string for a given date |
static String |
date2day(int time)
Deprecated. Return a string for a given date |
static String |
date2string(int time)
Deprecated. Return a string for a given date |
static int |
dayInYear(Date d)
Deprecated. Return the number of days that have elapsed from the beginning of the year to the given date |
static int |
daysInMonth(int year,
int month)
Deprecated. Return the number of days in the month in a specified year. |
static int |
getDayInt(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the number of the day in the month as an integer |
static long |
getMilliOffset()
Deprecated. Return the time-difference between our timezone and GMT |
static String |
getMonth(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the number of the month |
static String |
getMonthDay(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the day in the month |
static int |
getMonthInt(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the month as an integer |
static String |
getTime(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the time as a string |
static String |
getTimeSec(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the time as a string |
static String |
getTimeSecLen(int val)
Deprecated. Takes an integer representing the number of seconds from 00:00:00 and returns the time as a string |
static int |
getWeekDayInt(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the number of the day in the week as an integer |
static String |
getYear(int val)
Deprecated. Takes an integer representing the number of seconds from 1-Jan-1970 00:00:00 and returns the year |
static void |
main(String[] args)
Deprecated. Main method used for testing purposes |
static String |
makedbmdate(Date da)
Deprecated. Create date strings in the form yyyy-mm-dd for a given Date object This format is used in several database (dbm's) |
static long |
milliDate(int year,
int week)
Deprecated. Return the number milliseconds elapsed from 1-Jan-1970 to the beginning of the given week. |
static Calendar |
parseDate(Calendar cal,
String date)
Deprecated. Parse a string containing a date and put it in a calendar |
static int |
parsedate(String sDate)
Deprecated. Returns the number of seconds from 1-Jan-1970 to a given date |
static Calendar |
parseDateRev(Calendar cal,
String date)
Deprecated. Parse a string containing a date and put it in a calendar, the string is in reversed order |
static int |
parsedatetime(String wh)
Deprecated. Returns the number of seconds from 1-Jan-1970 00:00:00 to a given time |
static Date |
parsedbmdate(String wh)
Deprecated. Parse date strings in the form yyyy-mm-dd This format is used in several database (dbm's) |
static int |
parsetime(String wh)
Deprecated. Returns the number of seconds from 00:00:00 to a given time |
static int |
secondInYear(Date d)
Deprecated. Return the number of seconds that have elapsed from the beginning of the year to the given date |
static int |
weekInYear(Date d)
Deprecated. Return the number of weeks that have elapsed from the beginning of the year to the given date |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DateSupport()
| Method Detail |
public static int daysInMonth(int year,
int month)
year - The year valid values 0..100 where 0 is y2k 2000 untill 89 => 2089 and 90 being the year 1990month - The month where 0 is januaripublic static int secondInYear(Date d)
d - The date
daysInMonth(int, int),
dayInYear(java.util.Date),
weekInYear(java.util.Date)public static int dayInYear(Date d)
d - The date
daysInMonth(int, int),
secondInYear(java.util.Date),
weekInYear(java.util.Date)public static int weekInYear(Date d)
d - The date
daysInMonth(int, int),
secondInYear(java.util.Date),
dayInYear(java.util.Date)
public static long milliDate(int year,
int week)
year - The yearweek - The number of the week
public static Date Date(int year,
int week,
int day)
year - The yearweek - The weekday - The number of the day in the week
public static String makedbmdate(Date da)
da - The date input
parsedbmdate(java.lang.String)public static Date parsedbmdate(String wh)
wh - The string representing the date in 'yyyy-mm-dd' format
makedbmdate(java.util.Date)public static String colontime(String time)
time - A string in RFC-1223 format
public static int parsedate(String sDate)
sDate - String in the form 'yyyyMMdd'
parsetime(java.lang.String),
parsedatetime(java.lang.String)public static int parsetime(String wh)
wh - Time in the form 'hhmmss'
parsedate(java.lang.String),
parsedatetime(java.lang.String)public static int parsedatetime(String wh)
wh - Date in the form 'yyyymmddhhmmss'
parsedate(java.lang.String),
parsetime(java.lang.String)public static String getTime(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTimeSec(int),
getTimeSecLen(int),
getMonthDay(int),
getMonth(int),
getYear(int),
getMonthInt(int),
getWeekDayInt(int),
getDayInt(int)public static String getTimeSec(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSecLen(int),
getMonthDay(int),
getMonth(int),
getYear(int),
getMonthInt(int),
getWeekDayInt(int),
getDayInt(int)public static String getTimeSecLen(int val)
val - Number of seconds from 00:00:00
getTime(int),
getTimeSec(int),
getMonthDay(int),
getMonth(int),
getYear(int),
getMonthInt(int),
getWeekDayInt(int),
getDayInt(int)public static String getMonthDay(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSec(int),
getTimeSecLen(int),
getMonth(int),
getYear(int),
getMonthInt(int),
getWeekDayInt(int),
getDayInt(int)public static String getMonth(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSec(int),
getTimeSecLen(int),
getMonthDay(int),
getYear(int),
getMonthInt(int),
getWeekDayInt(int),
getDayInt(int)public static String getYear(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSec(int),
getTimeSecLen(int),
getMonthDay(int),
getMonth(int),
getMonthInt(int),
getWeekDayInt(int),
getDayInt(int)public static int getMonthInt(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSec(int),
getTimeSecLen(int),
getMonthDay(int),
getMonth(int),
getYear(int),
getWeekDayInt(int),
getDayInt(int)public static int getWeekDayInt(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSec(int),
getTimeSecLen(int),
getMonthDay(int),
getMonth(int),
getYear(int),
getMonthInt(int),
getDayInt(int)public static int getDayInt(int val)
val - Number of seconds from 1-Jan-1970 00:00:00
getTime(int),
getTimeSec(int),
getTimeSecLen(int),
getMonthDay(int),
getMonth(int),
getYear(int),
getMonthInt(int),
getWeekDayInt(int)public static long getMilliOffset()
public static long currentTimeMillis()
public static long convertDateToLong(String date)
date - String which contains the date and time in the format "hour:minutes:sec day/month/year"
public static Calendar parseDate(Calendar cal,
String date)
cal - Calander object that is used for storing the parsed datedate - String in the form: hour:minute:second day/month/year
parseDateRev
public static Calendar parseDateRev(Calendar cal,
String date)
cal - Calander object that is used for storing the parsed datedate - String in the form: year/month/day hour:minute:second
parseDatepublic static String date2string(int time)
time - Integer representing the time in seconds since 1-Jan-1970 00:00:00
date2day(int),
date2date(int)public static String date2day(int time)
time - Integer representing the time in seconds since 1-Jan-1970 00:00:00
date2string(int),
date2date(int)public static String date2date(int time)
time - Integer representing the time in seconds since 1-Jan-1970 00:00:00
date2string(int),
date2day(int)public static void main(String[] args)
args - Array of arguments
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||