|
at.glawar GlawarDate [2006-07-04] |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectat.glawar.gladate.GLADate
This class deals with date methods.
If TIME is used, this class always uses the TimeZone
Europe/Vienna. That means that HOUR's range is from 0 to 23,
MINUTE's and SECOND's range is from 0 to 59 and MILLISECOND's range is
from 0 to 999.
| Constructor Summary | |
GLADate()
|
|
| Method Summary | |
static Date |
castSQL2UtilDate(Date dValue)
cast a java.util.Date out from a java.sql.Date. |
static Date |
castUtil2SQLDate(Date dValue)
cast a java.sql.Date out from a java.util.Date. |
static String |
Date2String(Date dValue)
formats a date-value to a string (but only the date). |
static String |
Date2String(Date dValue,
boolean isFullLength,
String strSeparator)
formats a date-value to a string (but only the date). |
static String |
Date2String(Date dValue,
String strSeparator)
formats a date-value to a string (but only the date). |
static String |
Date2StringReverse(Date dValue)
formats a date-value to a string. |
static String |
Date2StringReverse(Date dValue,
boolean isFullLength,
String strSeparator)
formats a date-value to a string. |
static String |
Date2StringReverse(Date dValue,
String strSeparator)
formats a date-value to a string. |
static String |
formatDateYYYY_Minus_MM_Minus_DD(Date dValue)
format a given date-value into a string yyyy-mm-dd. |
static String |
formatSQLDate2OracleParam(Date date,
String patternJava,
String patternOracle)
create String that is necessary to write a Date-value into an Oracle database. |
static String |
getDateEntry()
get actual date inf form of yyyy-mm-dd HH:MM:SS. |
static Date |
getToday()
get actual date and time |
static Date |
getTodayWithoutTime()
get actual date and time 00:00:00:000. |
static Date |
getTomorrow()
get tomorrow's date with actual time. |
static Date |
getTomorrowWithoutTime()
get tomorrow's date with time 00:00:00:000. |
static Date |
getYesterday()
get yesterday's date with actual time. |
static Date |
getYesterdayWithoutTime()
get yesterday's date with time 00:00:00:000. |
static boolean |
isDayBeforeToday(Date dValue)
This method checks if the given date is before the actual day (today). |
static boolean |
isSameDay(Date dValue1,
Date dValue2)
tests, if the date of two java.util.Date-values are equal. |
static boolean |
isUndefinedJavaDate(Date date)
checks if the given date is an undefined java date. |
static Date |
makeTimeFromString(Object obj)
makes a java.util.Date of an object. |
static String |
makeTodayString()
make a string of todays date and time |
static Date |
set2NoTime(Date dValue)
set the actual date to time 00:00:00:000. |
static Date |
setDate(int iDay,
int iMonth,
int iYear)
sets only date, the time will be set to 00:00:00:000. |
static Date |
setDate2Time(Date dValue,
int iHour,
int iMinute,
int iSecond,
int iMiliSecond)
set a java.utilDate to a special time |
static Date |
setDateAndTime(int iDay,
int iMonth,
int iYear,
int iHour,
int iMin,
int iSec,
int iMilliSec)
sets date and time. |
static Date |
setUndefinedOracleDate()
set a date-value that identifies Oracle as undefined |
static Date |
setUndefinedOracleDateWithoutTime()
set a date-vale that identifies Oracle as undefined plus time 00:00:00:000. |
static Date |
String2Date(String strDate)
formats a given date-string into a date |
static Date |
String2Date(String strDate,
boolean bWithTime)
formats a given date-string |
static String |
Time2String(Date dValue)
formats a date-value to a string (but only the time). |
static String |
Time2String(Date dValue,
boolean isFullLength,
String strSeparator)
formats a date-value to a string (but only the time). |
static String |
Time2String(Date dValue,
String strSeparator)
formats a date-value to a string (but only the time). |
static String |
toRFC822String()
return the actual date-value as an RFC-822. |
static String |
toRFC822String(Date dValue)
return the given date-value as an RFC-822. |
static String |
toTimeDifference(long lValue)
formats the given time period in miliseconds to a timedifference to GMT. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GLADate()
| Method Detail |
public static Date castUtil2SQLDate(Date dValue)
cast a java.sql.Date out from a java.util.Date.
dValue - the java.util.Date to cast to
public static Date castSQL2UtilDate(Date dValue)
cast a java.util.Date out from a java.sql.Date.
dValue - the java.sql.Date to cast to
public static String Time2String(Date dValue,
boolean isFullLength,
String strSeparator)
dValue - java.util.Date-value that should be formattedisFullLength - if set to true it means that not an empty
string will be returned if dValue is null but a string
of length 10strSeparator - the separator between the values, if null
the standard-separator will be taken, which is :;
this parameter's max length is 1!
null
(depending on the parameter isFullLength) or the
formatted date HH:MM:SS:mmmpublic static String Time2String(Date dValue)
dValue - java.util.Date-value that should be formatted
null
or the formatted date HH:MM:SS:mmm
public static String Time2String(Date dValue,
String strSeparator)
dValue - java.util.Date-value that should be formattedstrSeparator - the separator between the values, if null
the standard-separator will be taken, which is :;
this parameter's max length is 1!
null
or the formatted date HH:MM:SS:mmm
public static String Date2String(Date dValue,
boolean isFullLength,
String strSeparator)
dValue - java.util.Date-value that should be formattedisFullLength - if set to true it means that not an empty
string will be returned if dValue is null but a string
of length 10strSeparator - the separator between the values, if null
the standard-separator will be taken, which is .;
this parameter's max length is 1!
null
(depending on the parameter isFullLength) or the
formatted date dd.mm.yyyypublic static String Date2String(Date dValue)
dValue - java.util.Date-value that should be formatted
null or the
formatted date dd.mm.yyyy
public static String Date2String(Date dValue,
String strSeparator)
dValue - java.util.Date-value that should be formattedstrSeparator - the separator between the values, if null
the standard-separator will be taken, which is .;
this parameter's max length is 1!
null or the
formatted date dd.mm.yyyy
public static String Date2StringReverse(Date dValue,
boolean isFullLength,
String strSeparator)
dValue - java.util.Date-value that should be formattedisFullLength - if set to true it means that not an empty
string will be returned if dValue is null but a string
of length 10strSeparator - the separator between the values, if null
the standard-separator will be taken, which is .;
this parameter's max length is 1!
null
(depending on the parameter isFullLength) or the
formatted date yyyy.mm.dd
public static String Date2StringReverse(Date dValue,
String strSeparator)
dValue - java.util.Date-value that should be formattedstrSeparator - the separator between the values, if null
the standard-separator will be taken, which is .;
this parameter's max length is 1!
null or the
formatted date yyyy.mm.ddpublic static String Date2StringReverse(Date dValue)
dValue - java.util.Date-value that should be formatted
null or the
formatted date yyyy.mm.dd
public static Date setDateAndTime(int iDay,
int iMonth,
int iYear,
int iHour,
int iMin,
int iSec,
int iMilliSec)
sets date and time.
iDay - dayiMonth - monthiYear - yeariHour - houriMin - minuteiSec - secondiMilliSec - millisecond
public static Date setDate(int iDay,
int iMonth,
int iYear)
00:00:00:000.
iDay - dayiMonth - monthiYear - year
00:00:00:000public static Date makeTimeFromString(Object obj)
obj - String containing hh:mm
01:00:00:0000
public static Date setDate2Time(Date dValue,
int iHour,
int iMinute,
int iSecond,
int iMiliSecond)
dValue - the java.util.Date to setiHour - hour to setiMinute - minute to setiSecond - second to setiMiliSecond - millisecond to set
null if the dValue was null or
the original date plus the set timepublic static Date set2NoTime(Date dValue)
00:00:00:000.
dValue - the java.util.Date to set to no time
00:00:00:000public static Date setUndefinedOracleDate()
public static Date setUndefinedOracleDateWithoutTime()
00:00:00:000.
00:00:00:000public static boolean isUndefinedJavaDate(Date date)
date - Date-value to check
true if the parameter is the default date value in
java (01.01.1970), otherwise falsepublic static Date getToday()
public static Date getTodayWithoutTime()
00:00:00:000.
00:00:00:000public static Date getYesterday()
public static Date getYesterdayWithoutTime()
00:00:00:000.
00:00:00:000) but
yesterdaypublic static Date getTomorrow()
public static Date getTomorrowWithoutTime()
00:00:00:000.
00:00:00:000) but
tomorrow
public static String formatSQLDate2OracleParam(Date date,
String patternJava,
String patternOracle)
date - the java.util.Date to write into Oracle databasepatternJava - e. g. dd-MM-yyyy HH:mmpatternOracle - e. g. dd-mm-yyyy hh24:mi
public static boolean isSameDay(Date dValue1,
Date dValue2)
tests, if the date of two java.util.Date-values are equal.
The time is not checked!
If both date-values arenull, this method also returns
true
dValue1 - date1dValue2 - date2
true if the dates are equal, false
otherwisepublic static Date String2Date(String strDate)
strDate - string representing a valid date (yyyyMMdd)
public static Date String2Date(String strDate,
boolean bWithTime)
strDate - string representing a valid datebWithTime - if true strDate will be yyyyMMddHHmmss else strDate
will be yyyyMMdd
public static String makeTodayString()
public static final boolean isDayBeforeToday(Date dValue)
This method checks if the given date is before the actual day (today).
dValue - date to check
true if the given date is before today,
false otherwise and also if dValue is nullpublic static String getDateEntry()
get actual date inf form of yyyy-mm-dd HH:MM:SS.
yyyy-mm-dd HH:MM:SSpublic static final String formatDateYYYY_Minus_MM_Minus_DD(Date dValue)
format a given date-value into a string yyyy-mm-dd.
| what ... | more information |
|---|---|
| original author | DI Franz-Peter Glawar |
| last modified by | FP |
dValue - java.util.Date to format
null if dValue is null
otherwise the date formatted as yyyy-mm-ddpublic static final String toTimeDifference(long lValue)
formats the given time period in miliseconds to a timedifference to GMT.
lValue - time in milliseconds
lValue is 0 otherwise the
difference in + or - and then
HHMM (e. g. +0230)public static final String toRFC822String()
return the actual date-value as an RFC-822.
Sun, 02 Jul 2006 16:04:00 +0200)public static final String toRFC822String(Date dValue)
return the given date-value as an RFC-822.
dValue - valid date
Sun, 02 Jul 2006 16:04:00 +0200)
|
software.glawar.at | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||