Package com.adobe.xfa.ut
Class ISODateTime
java.lang.Object
com.adobe.xfa.ut.ISODateTime
The class ISODateTime is a convenience class grouping the
ISODate and ISOTime classes, to define objects
in support of ISO8601/XFA date time patterns.
A valid ISO8601/XFA date time string is the concatenation
of a valid ISO8601/XFA date string and a valid ISO8601/XFA time string
with the letter 'T' acting as a separator between the date
and time elements of the string.
See ISODate and ISOTime for the definitions of
valid ISO8601/XFA date and time patterns.
Here's a snippet of code illustrating the use of
ISODateTime to reformat an ISO8601/XFA datetime string
#include <pub/ut/isodatetime.h> // for defn of ISODateTime.
#include <pub/ut/string.h> // for defn of String.
...
ISODateTime dt("2000-02-28T11:12:13-05:00");
String s("Unknown");
if (dt.isValid())
s = dt.format(ISODateTime.getXFA_DATETIME_FMT1());
printf("%S\n", (const wchar_t *) s);
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstantiate an ISODateTime object from today's date and time.ISODateTime(String datetime, String datelocale, String timelocale) Instantiate an ISODateTime object from the given date time string. -
Method Summary
Modifier and TypeMethodDescriptionFormat this object given the ISO datetime format string.getDate()Get date component of this objectgetTime()Get time component of this objectbooleanisValid()Determine if this object is valid.voidSet this object to operate on Greenwich Mean (date and) time, which is the default.voidSet this object to operate on local (date and) time as opposed to the default, which is Greenwich Mean (date and) time.
-
Field Details
-
XFA_DATETIME_FMT1
An ISO8601/XFA date time pattern string: YYYYMMDDTHHMMSS.FFFz.- See Also:
-
XFA_DATETIME_FMT2
An alternate ISO8601/XFA date time pattern string: YYYY-MM-DDTHH:MM:SS.FFFzz.- See Also:
-
-
Constructor Details
-
ISODateTime
public ISODateTime()Instantiate an ISODateTime object from today's date and time. -
ISODateTime
Instantiate an ISODateTime object from the given date time string.- Parameters:
datetime- an ISO8601/XFA date time string.datelocale- a date locale name.timelocale- a time locale name.
-
-
Method Details
-
setLocalTime
public void setLocalTime()Set this object to operate on local (date and) time as opposed to the default, which is Greenwich Mean (date and) time. Any subsequent calls to the format method will result in date time strings that are expressed in local time. -
setGMTime
public void setGMTime()Set this object to operate on Greenwich Mean (date and) time, which is the default. Any subsequent calls to the format method will result in date time strings that are expressed in Greenwich Mean time. -
format
Format this object given the ISO datetime format string.- Parameters:
isoformat- an ISO8601/XFA date time format string.- Returns:
- the date time string formatted according to the given format string, upon success, or the empty string, upon error.
-
isValid
public boolean isValid()Determine if this object is valid.- Returns:
- boolean true if valid, and false otherwise.
-
getDate
Get date component of this object- Returns:
- date
-
getTime
Get time component of this object- Returns:
- time
-