public interface DateTimeFactory extends ValueFactory<DateTime>
date-time instants
. This interface extends the ValueFactory
generic interface
and adds specific methods for creating instants for the current time (and time zone) as well as various combinations of
individual field values. The factory creates date-time instants from strings that are in the standard ISO-8601 format. The format this factory supports is month-based. The month-based representation is the most common format of ISO8601, and is the format used in the XML standards for passing dates and times:
yyyy-mm-ddTHH:MM:SS.SSSZThe fields are separated by dashes and consist of:
HH:mm
(or '0' if UTC)DEFAULT_DECODER, DEFAULT_ENCODER
Modifier and Type | Method and Description |
---|---|
DateTime |
create()
Create a date-time instance for the current time in the local time zone.
|
DateTime |
create(DateTime original,
long offsetInMillis)
Create a date-time instance that is offset from the original by the specified amount.
|
DateTime |
create(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisecondsOfSecond)
Create a date-time instance given the individual values for the fields
|
DateTime |
createUtc()
Create a date-time instance for the current time in UTC.
|
DateTimeFactory |
with(ValueFactories valueFactories)
Return a potentially new copy of this factory that uses the supplied ValueFactories object.
|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, createEmptyArray, getPropertyType
DateTimeFactory with(ValueFactories valueFactories)
ValueFactory
with
in interface ValueFactory<DateTime>
valueFactories
- the value factories object; may not be nullDateTime create()
createUtc()
DateTime createUtc()
create()
DateTime create(DateTime original, long offsetInMillis)
original
- the original DateTime
offsetInMillis
- the offset in milliseconds (positive or negative)DateTime create(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisecondsOfSecond)
year
- the year of the eramonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisecondsOfSecond
- the milliseconds of the secondCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.