Package com.lariflix.jemm.utils
Class TransformDateFormat
java.lang.Object
com.lariflix.jemm.utils.TransformDateFormat
Utility class for transforming date formats.
This class provides methods for converting dates between different formats.
- Since:
- 1.0
- Author:
- Cesar Bianchi
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the TransformDateFormat class. -
Method Summary
Modifier and TypeMethodDescriptionconvertToFull
(Date dt) Converts a Date object into a full date string in the format "yyyy-MM-dd'T'HH:mm:ss'Z'".Converts a simple date string in the format "dd/MM/yyyy" into a Date object.getSimpleDateFromFull
(Date date) Converts a Date object into a simple date string in the format "dd/MM/yyyy".
-
Constructor Details
-
TransformDateFormat
public TransformDateFormat()Default constructor for the TransformDateFormat class. This constructor is used when creating a new instance of this class without setting any initial values.- Since:
- 1.0
-
-
Method Details
-
getSimpleDateFromFull
Converts a Date object into a simple date string in the format "dd/MM/yyyy". If the provided date is null, an empty string is returned.- Parameters:
date
- The Date object to be converted.- Returns:
- A string representing the date in the format "dd/MM/yyyy", or an empty string if the date is null.
- Since:
- 1.0
-
getFullDateFromSimple
Converts a simple date string in the format "dd/MM/yyyy" into a Date object. If the provided string is not in the correct format, a ParseException is thrown.- Parameters:
dt
- The date string to be converted.- Returns:
- A Date object representing the date, or null if the string is not in the correct format.
- Throws:
ParseException
- if the string is not in the correct format.- Since:
- 1.0
-
convertToFull
Converts a Date object into a full date string in the format "yyyy-MM-dd'T'HH:mm:ss'Z'". If the provided date is null, an empty string is returned.- Parameters:
dt
- The Date object to be converted.- Returns:
- A string representing the date in the format "yyyy-MM-dd'T'HH:mm:ss'Z'", or an empty string if the date is null.
- Since:
- 1.0
-