TimePeriod.parse("1000");to create a a constant, one second period. Another way to create period is to use one of the values from {@link TimePeriod.Unit}. Combining integer value with the unit name simplifies expressing longer periods, for example:
TimePeriod.parse("2[DAY]");gives just two days constant period. There is also a way to express relative periods. Giving:
TimePeriod.parse("08:00");gives a period from now on to the closest eight o'clock am every day. It is also possible to use one of the values of {@link TimePeriod.DayOfWeek}, like this:
TimePeriod.parse("monday");which means period from now on to the begining of the closes Monday, or even more specific way:
TimePeriod.parse("monday 08:00");to have period from now on to the eight o'clock am of the Monday. It is also possible to parse array of time periods:
TimePeriod.parse("08:00,sunday 10:00");which gives period of eight o'clock every day and ten o'clock every sunday, whatever comes first.
Example: "2 h 30 m". By convention, terms are specified largest to smallest. A term without a unit is assumed to be milliseconds. Units are case insensitive ("h" or "H" are treated the same).
java.util.Date
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|