public class OADate extends OADateTime
OADate is not affected by timezone. A date created on one system will be the same on another machine, even if the timezone is different. See OADateTime for list or formatting symbols.
OADateTime
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected static String |
dateOutputFormat
default output format.
|
static String |
Format1 |
static String |
Format2 |
static String |
Format3 |
static String |
Format4 |
static String |
Format5 |
static String |
Format6 |
_time, format, FORMAT_long, staticOutputFormat, timeZone
Constructor and Description |
---|
OADate()
Create a new date that uses todays date.
|
OADate(Calendar c)
Create a new date that uses a specified Calendar.
|
OADate(Date date)
Create a new date that uses a specified Date.
|
OADate(int year,
int month,
int day)
Create new date using year, month, day.
|
OADate(long time) |
OADate(OADateTime odt)
Create a new date that uses a specified OADateTime.
|
OADate(String strDate)
Create a new date from a specified String.
|
OADate(String strDate,
String format)
Create a new date from a specified String, using a specified format.
|
OADate(Time time)
Create a new date that uses a specified Time.
|
Modifier and Type | Method and Description |
---|---|
static void |
addGlobalParseFormat(String fmt)
Sets the default global parse format used when converting a String to OADate.
|
boolean |
between(Object obj1,
Object obj2)
Compares this date with two dates to see if this date is between them.
|
static OADate |
dateValue(String date)
Converts a String to an OADate.
|
static OADate |
dateValue(String date,
String fmt)
Converts a String to an OADate.
|
static String |
getGlobalOutputFormat()
Returns the default global format used when converting OADate to String.
|
static void |
removeAllGlobalParseFormats()
Removes all global parse formats that are used to convert Strings to OADates.
|
static void |
removeGlobalParseFormat(String fmt)
Removes a global parse format used when converting a String to OADate.
|
static void |
setGlobalOutputFormat(String fmt)
Sets the default global format used when converting OADate to String.
|
static void |
setLocale(Locale loc) |
String |
toString()
Converts this date to a String value using default format.
|
String |
toString(String f)
Converts this date to a String value using specified format.
|
static OADateTime |
valueOf(String date)
Converts a String to an OADate.
|
static OADateTime |
valueOf(String date,
String fmt)
Converts a String to an OADate.
|
static OADateTime |
valueOf2(String date)
Throws an exception if date if not valid.
|
_getCal, _releaseCal, addDay, addDays, addHours, addMilliSeconds, addMinutes, addMonths, addSeconds, addWeeks, addYears, after, before, betweenDays, betweenHours, betweenMilliSeconds, betweenMinutes, betweenMonths, betweenSeconds, betweenYears, clearDate, clearSecondAndMilliSecond, clearTime, compare, compareTo, convert, convertTo, equals, fixDate, get12Hour, get24Hour, getAM_PM, getCalendar, getDate, getDay, getDayOfWeek, getDayOfYear, getDaysInMonth, getFormat, getFormat, getFormat, getFormatter, getHour, getMilliSecond, getMinute, getMonth, getSecond, getTime, getTimeZone, getWeekOfMonth, getWeekOfYear, getYear, hashCode, isAfter, isBefore, main, set12Hour, set24Hour, setAM_PM, setCalendar, setCalendar, setCalendar, setCalendar, setCalendar, setCalendar, setCalendar, setCalendar, setDate, setDate, setDay, setFormat, setHour, setMilliSecond, setMinute, setMonth, setSecond, setTime, setTime, setTime, setTime, setTimeZone, setYear, test, toStringMain, valueOfMain
public static final String Format1
public static final String Format2
public static final String Format3
public static final String Format4
public static final String Format5
public static final String Format6
protected static String dateOutputFormat
public OADate()
public OADate(Date date)
public OADate(long time)
public OADate(Time time)
public OADate(Calendar c)
public OADate(OADateTime odt)
public OADate(String strDate)
public OADate(String strDate, String format)
public OADate(int year, int month, int day)
year
- full year (not year minus 1900 like Date)
param month 0-11, use Calendar.JUNE, etc.
param date day of the month (1-31)public static void setLocale(Locale loc)
public static void setGlobalOutputFormat(String fmt)
OADateTime.setFormat(java.lang.String)
public static String getGlobalOutputFormat()
public static void addGlobalParseFormat(String fmt)
OADateTime.setFormat(java.lang.String)
public static void removeGlobalParseFormat(String fmt)
public static void removeAllGlobalParseFormats()
public boolean between(Object obj1, Object obj2)
obj2
- Date, OADate, Calendarpublic String toString()
toString
in class OADateTime
OADateTime
public String toString(String f)
toString
in class OADateTime
f
- is format to applyOADateTime
public static OADate dateValue(String date, String fmt)
valueOf(String,String)
public static OADate dateValue(String date)
valueOf(String,String)
public static OADateTime valueOf(String date, String fmt)
fmt
- is format to use for parsing. See OADateTime for list of formatting symbols.OADateTime
,
valueOf(String,String)
,
OADateTime
public static OADateTime valueOf(String date)
valueOf(String,String)
public static OADateTime valueOf2(String date)
Copyright © 1999–2019 ViaOA. All rights reserved.