Class DateBuilder
java.lang.Object
ch.tocco.nice2.optional.calendar.api.util.DateBuilder
A convenience class for create date and date-time objects.
Please have a look at the test class for examples on how to use it.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.DateTime
org.joda.time.Instant
Creates aInstant
.clear()
Clears all set values.Sets the date (not time!!) from the string.setDayOfMonth
(int dom) setHour
(int hour) setMillis
(int millis) setMinute
(int min) setMonth
(int month) setSecond
(int sec) Sets the time from the specified string.setYear
(int year)
-
Constructor Details
-
DateBuilder
public DateBuilder()
-
-
Method Details
-
buildDateTime
public org.joda.time.DateTime buildDateTime() -
buildInstant
public org.joda.time.Instant buildInstant()Creates aInstant
. Note, if you only set time infos, this will default to 1970-01-01. -
clear
Clears all set values. -
setDayOfMonth
-
setMonth
-
setYear
-
setDate
Sets the date (not time!!) from the string. Useyyyy-MM-dd
pattern, for example: 2002-09-23. -
setHour
-
setMinute
-
setSecond
-
setMillis
-
setTime
Sets the time from the specified string. UseHH:mm[:ss]
pattern, where the seconds are optional.
-