Package app.YUP.utils

Class DateTimeConverter

java.lang.Object
app.YUP.utils.DateTimeConverter

public class DateTimeConverter extends Object
Utility class for converting LocalDateTime to different string formats. This class cannot be instantiated.
  • Method Details

    • convertToMonthDay

      public static String convertToMonthDay(LocalDateTime dateTime)
      Converts a LocalDateTime to a string format of "MMMM d" (e.g., "January 1").
      Parameters:
      dateTime - the LocalDateTime to be converted.
      Returns:
      a string representation of the date in "MMMM d" format.
    • convertTo24Hour

      public static String convertTo24Hour(LocalDateTime dateTime)
      Converts a LocalDateTime to a string format of "HH:mm" (24-hour format).
      Parameters:
      dateTime - the LocalDateTime to be converted.
      Returns:
      a string representation of the time in "HH:mm" format.