Functions: FnDateTime

1. Overview

FnDateTime is a function hub class containing a lot of static methods to convert from various input objects to DateTime. Those static methods return functions whose output is DateTime and whose input can be Calendar, Date, Integer list and Long among others.

2. Functions

Function nameTypeParamsDescription
calendarToDateTimeFunction<T, DateTime>

It converts a Calendar into a DateTime

calendarToDateTimeFunction<T, DateTime>DateTimeZone dateTimeZone

It converts a Calendar into a DateTime in the given DateTimeZone

calendarToDateTimeFunction<T, DateTime>Chronology chronology

It converts a Calendar into a DateTime with the given Chronology

dateToDateTimeFunction<T, DateTime>

The input Date is converted into a DateTime

dateToDateTimeFunction<T, DateTime>DateTimeZone dateTimeZone

The input Date is converted into a DateTime configured with the given DateTimeZone

dateToDateTimeFunction<T, DateTime>Chronology chronology

The input Date is converted into a DateTime with the given Chronology

integerFieldArrayToDateTimeFunction<Integer[], DateTime>

A DateTime is created from the given Integer array.

The valid input Integer[] are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
integerFieldArrayToDateTimeFunction<Integer[], DateTime>Chronology chronology

A DateTime is created from the given Integer array. The result will be created with the given Chronology

The valid input Integer[] are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
integerFieldCollectionToDateTimeFunction<Collection<Integer>, DateTime>

A DateTime is created from the input Integer Collection.

The valid input Collection<Integer> are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
integerFieldCollectionToDateTimeFunction<Collection<Integer>, DateTime>Chronology chronology

A DateTime is created from the input Integer Collection. The result will be created with the given Chronology

The valid input Collection<Integer> are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
longToDateTimeFunction<Long, DateTime>

The input Long representing the time in milliseconds is converted into a DateTime

longToDateTimeFunction<Long, DateTime>DateTimeZone dateTimeZone

The input Long representing the time in milliseconds is converted into a DateTime in the given DateTimeZone

longToDateTimeFunction<Long, DateTime>Chronology chronology

The input Long representing the time in milliseconds is converted into a DateTime with the given Chronology

strFieldArrayToDateTimeFunction<String[], DateTime>

A DateTime is created from the given String array.

The valid input String[] are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
strFieldArrayToDateTimeFunction<String[], DateTime>Chronology chronology

A DateTime is created from the given String array. The result will be created with the given Chronology

The valid input String[] are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
strFieldCollectionToDateTimeFunction<Collection<String>, DateTime>

A DateTime is created from the given String Collection.

The valid input Collection<String> are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
strFieldCollectionToDateTimeFunction<Collection<String>, DateTime>Chronology chronology

A DateTime is created from the given String Collection. The result will be created with the given Chronology

The valid input Collection<String> are:

  • year (month and day will be set to 1)
  • year, month (day will be set to 1)
  • year, month, day
strToDateTimeFunction<String, DateTime>String pattern

It converts the input String into a DateTime using the given pattern parameter. If the pattern includes either, the name of the month or day of week, a conversion accepting a Locale must be used instead

strToDateTimeFunction<String, DateTime>String pattern
DateTimeZone dateTimeZone

It converts the input String into a DateTime using the given pattern parameter and with the given DateTimeZone. If the pattern includes either, the name of the month or day of week, a conversion accepting a Locale must be used instead

strToDateTimeFunction<String, DateTime>String pattern
Chronology chronology

It converts the input String into a DateTime using the given pattern parameter and with the given Chronology. If the pattern includes either, the name of the month or day of week, a conversion accepting a Locale must be used instead

strToDateTimeFunction<String, DateTime>String pattern
Locale locale

It converts the input String into a DateTime using the given pattern and Locale parameters

strToDateTimeFunction<String, DateTime>String pattern
String locale

It converts the given String into a DateTime using the given pattern and Locale parameters

strToDateTimeFunction<String, DateTime>String pattern
Locale locale
DateTimeZone dateTimeZone

It converts the given String into a DateTime using the given pattern and Locale parameters. The DateTime is configured with the given DateTimeZone

strToDateTimeFunction<String, DateTime>String pattern
String locale
DateTimeZone dateTimeZone

It converts the given String into a DateTime using the given pattern and Locale parameters. The DateTime is configured with the given DateTimeZone

strToDateTimeFunction<String, DateTime>String pattern
Locale locale
Chronology chronology

It converts the input String into a DateTime using the given pattern and Locale parameters. The DateTime will be created with the given Chronology

strToDateTimeFunction<String, DateTime>String pattern
String locale
Chronology chronology

It converts the input String into a DateTime using the given pattern and Locale parameters. The DateTime will be created with the given Chronology

timestampToDateTimeFunction<Timestamp, DateTime>

The input Timestamp is converted into a DateTime

timestampToDateTimeFunction<Timestamp, DateTime>DateTimeZone dateTimeZone

The input Timestamp is converted into a DateTime in the given DateTimeZone

timestampToDateTimeFunction<Timestamp, DateTime>Chronology chronology

The input Timestamp is converted into a DateTime with the given Chronology