Package app.YUP.utils
Class DateTimeConverter
java.lang.Object
app.YUP.utils.DateTimeConverter
Utility class for converting LocalDateTime to different string formats.
This class cannot be instantiated.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertTo24Hour(LocalDateTime dateTime) Converts a LocalDateTime to a string format of "HH:mm" (24-hour format).static StringconvertToMonthDay(LocalDateTime dateTime) Converts a LocalDateTime to a string format of "MMMM d" (e.g., "January 1").
-
Method Details
-
convertToMonthDay
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
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.
-