Package 

Class DatesKt

  • All Implemented Interfaces:

    
    public final class DatesKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Long toNumber(LocalDateTime $self) Convert a date time to a number with the following format: YYYYMMDDHHmmss.
      final static Integer toNumber(LocalDate $self) Convert a date to an integer with the following format: YYYYMMDD.
      final static Integer toNumber(LocalTime $self) Convert a time to an integer with the following format: HHmmssSSS.
      final static ZonedDateTime withZone(LocalDateTime $self, ZoneId zoneId) Return the date time in a given time zone for a local date time.
      final static LocalDateTime toLocalDateTime(Long $self) Parse a date time from a formatted number with this format: YYYYMMDDHHmmss.
      final static LocalDateTime toLocalDateTime(Date $self) Convert a date to a local date time.
      final static LocalDate toLocalDate(Integer $self) Parse a date from a formatted integer with this format: YYYYMMDD.
      final static LocalDate toLocalDate(Date $self) Convert a date to a local date.
      final static LocalTime toLocalTime(Integer $self) Parse a time from a formatted integer with this format: HHmmssSSS.
      final static Date toDate(ZonedDateTime $self) Convert a zoned date time to a date.
      final static Date toDate(LocalDateTime $self) Convert a local date time to a date.
      final static Date toDate(LocalDate $self) Convert a local date to a date.
      final static Period parsePeriod(String text) Parse a time period allowing a more relaxed format: with spaces or commas, lowercase characters and not forcing the text to start with 'P'.
      final static Duration parseDuration(String text) Parse a time duration allowing a more relaxed format: with spaces or commas, lowercase characters and not forcing the text to start with 'P', however, the 'T' is still mandatory to separate date and time durations.
      final static LocalDate parseLocalDate(String text) Parse a local date allowing only to specify the year or the year and the month.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • toNumber

         final static Long toNumber(LocalDateTime $self)

        Convert a date time to a number with the following format: YYYYMMDDHHmmss.

      • toNumber

         final static Integer toNumber(LocalDate $self)

        Convert a date to an integer with the following format: YYYYMMDD.

      • toNumber

         final static Integer toNumber(LocalTime $self)

        Convert a time to an integer with the following format: HHmmssSSS.

      • withZone

         final static ZonedDateTime withZone(LocalDateTime $self, ZoneId zoneId)

        Return the date time in a given time zone for a local date time.

        Parameters:
        zoneId - Id of the target zone of the passed local date time.
      • toLocalDateTime

         final static LocalDateTime toLocalDateTime(Long $self)

        Parse a date time from a formatted number with this format: YYYYMMDDHHmmss.

      • toLocalDateTime

         final static LocalDateTime toLocalDateTime(Date $self)

        Convert a date to a local date time.

      • toLocalDate

         final static LocalDate toLocalDate(Integer $self)

        Parse a date from a formatted integer with this format: YYYYMMDD.

      • toLocalDate

         final static LocalDate toLocalDate(Date $self)

        Convert a date to a local date.

      • toLocalTime

         final static LocalTime toLocalTime(Integer $self)

        Parse a time from a formatted integer with this format: HHmmssSSS.

      • toDate

         final static Date toDate(ZonedDateTime $self)

        Convert a zoned date time to a date.

      • toDate

         final static Date toDate(LocalDateTime $self)

        Convert a local date time to a date.

      • toDate

         final static Date toDate(LocalDate $self)

        Convert a local date to a date.

      • parsePeriod

         final static Period parsePeriod(String text)

        Parse a time period allowing a more relaxed format: with spaces or commas, lowercase characters and not forcing the text to start with 'P'.

        Parameters:
        text - Text to be parsed to a time period.
      • parseDuration

         final static Duration parseDuration(String text)

        Parse a time duration allowing a more relaxed format: with spaces or commas, lowercase characters and not forcing the text to start with 'P', however, the 'T' is still mandatory to separate date and time durations.

        Parameters:
        text - Text to be parsed to a time duration.
      • parseLocalDate

         final static LocalDate parseLocalDate(String text)

        Parse a local date allowing only to specify the year or the year and the month. Missing month and day will be defaulted to january and one respectively.

        Parameters:
        text - Text to be parsed to a local date.