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 TypeMethodDescriptionCreates aDate
object.org.joda.time.DateTime
org.joda.time.Instant
Creates aInstant
.org.joda.time.LocalDate
Creates a local-date object that has no time information.org.joda.time.LocalDateTime
org.joda.time.LocalTime
Creates a local-time object that has no date information.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() -
buildDateTimeValue
-
buildInstant
public org.joda.time.Instant buildInstant()Creates aInstant
. Note, if you only set time infos, this will default to 1970-01-01. -
buildDate
Creates aDate
object. Note, if you only set time infos, this will default to 1970-01-01. -
buildLocalDate
public org.joda.time.LocalDate buildLocalDate()Creates a local-date object that has no time information. Note, if you only set time infos, this will default to 1970-01-01. -
buildLocalDateTime
public org.joda.time.LocalDateTime buildLocalDateTime() -
buildLocalTime
public org.joda.time.LocalTime buildLocalTime()Creates a local-time object that has no date information. -
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.
-