public class DateSupport extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static boolean |
dooffset
Deprecated.
Whether to sue the offset.
|
(package private) static int |
offset
Deprecated.
The offset for date conversions for the current zone, in seconds
|
| Constructor and Description |
|---|
DateSupport()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
static int offset
static boolean dooffset
true when initialization of this class succeeds.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 datedaysInMonth(int, int),
dayInYear(java.util.Date),
weekInYear(java.util.Date)public static int dayInYear(Date d)
d - The datedaysInMonth(int, int),
secondInYear(java.util.Date),
weekInYear(java.util.Date)public static int weekInYear(Date d)
d - The datedaysInMonth(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 weekpublic static Date Date(int year, int week, int day)
year - The yearweek - The weekday - The number of the day in the weekpublic static String makedbmdate(Date da)
da - The date inputparsedbmdate(java.lang.String)public static Date parsedbmdate(String wh)
wh - The string representing the date in 'yyyy-mm-dd' formatmakedbmdate(java.util.Date)public static String colontime(String time)
time - A string in RFC-1223 formatpublic 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:00getTimeSec(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:00getTime(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:00getTime(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:00getTime(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:00getTime(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:00getTime(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:00getTime(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:00getTime(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:00getTime(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/yearparseDateRevpublic 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:secondparseDatepublic static String date2string(int time)
time - Integer representing the time in seconds since 1-Jan-1970 00:00:00date2day(int),
date2date(int)public static String date2day(int time)
time - Integer representing the time in seconds since 1-Jan-1970 00:00:00date2string(int),
date2date(int)public static String date2date(int time)
time - Integer representing the time in seconds since 1-Jan-1970 00:00:00date2string(int),
date2day(int)public static void main(String[] args)
args - Array of argumentsMMBase 1.9-SNAPSHOT - ${javadoctimestamp}