Class DateUtils

java.lang.Object
org.ctan.site.services.DateUtils

public final class DateUtils extends Object
The class DateUtils contains the utilities for dates.
  • Field Details

    • LOCAL_DATE_TIME_FORMATTER

      public static final DateTimeFormatter LOCAL_DATE_TIME_FORMATTER
      The field LOCAL_DATE_TIME_FORMATTER contains the formatter for LocalDateTime.
    • DATE_TIME_FORMATTER

      public static final DateTimeFormatter DATE_TIME_FORMATTER
      The field LOCAL_DATE_TIME_FORMATTER contains the formatter for LocalDateTime.
    • LOCAL_DATE_TIME_FORMATTER_RFC_3339

      public static final DateTimeFormatter LOCAL_DATE_TIME_FORMATTER_RFC_3339
      The field LOCAL_DATE_TIME_FORMATTER_RFC_3339 contains the formatter for LocalDateTime according to RFC3339.
    • LOCAL_DATE_FORMATTER

      public static final DateTimeFormatter LOCAL_DATE_FORMATTER
      The field LOCAL_DATE_FORMATTER contains the formatter for LocalDateTime.
  • Method Details

    • formatDate

      public static String formatDate(Instant date)
      The method formatDate provides means to format a date according to contains the ISO date format without the time.
      Parameters:
      date - the date
      Returns:
      the formatted date
    • formatDate

      public static String formatDate(LocalDateTime date)
      The method formatDate provides means to format a date according to contains the ISO date format without the time.
      Parameters:
      date - the date
      Returns:
      the formatted date
    • formatDateTime

      public static String formatDateTime(Instant date)
      The method formatDateTime provides means to format a date according to contains the ISO date format including the time.
      Parameters:
      date - the date
      Returns:
      the formatted date
    • formatDateTime

      public static String formatDateTime(LocalDateTime date)
      The method formatDateTime provides means to format a date according to contains the ISO date format including the time.
      Parameters:
      date - the date
      Returns:
      the formatted date
    • formatDateTime

      public static String formatDateTime(long date)
      The method formatDateTime provides means to format a date according to contains the ISO date format including the time.
      Parameters:
      date - the date
      Returns:
      the formatted date
    • formatFullDateTime

      public static String formatFullDateTime(Instant instant)
      The method formatFullDateTime provides means to format a date according to contains the full ISO date format including the time.
      Parameters:
      instant - the date
      Returns:
      the formatted date
    • formatRfc3339

      public static String formatRfc3339(Instant date)
      The method formatRfc3339 provides means to format a date according to contains the ISO date format including the time.
      Parameters:
      date - the date
      Returns:
      the formatted date