Class DateConverter


  • public class DateConverter
    extends Object
    Utility class for converting dates to different formats
    Author:
    Maksim Bezrukov
    • Constructor Detail

      • DateConverter

        public DateConverter()
    • Method Detail

      • toUTCString

        public static String toUTCString​(Calendar calendar)
        Convert Calendar object to string representation in UTC form
        Parameters:
        calendar - passed date
        Returns:
        string representation of passed date
      • toUTCString

        public static String toUTCString​(Date time)
        Convert Date object to string representation in UTC form
        Parameters:
        time - passed date
        Returns:
        string representation of passed date
      • toUTCString

        public static String toUTCString​(String date)
        Convert string date representation to string representation in UTC form.

        Note: current implementation is not effective

        Parameters:
        date - passed date
        Returns:
        UTC string representation of passed date
      • toCalendar

        public static Calendar toCalendar​(String date)
        Convert string representation of date to Calendar object
        Parameters:
        date - passed string date
        Returns:
        Calendar date
      • toPDFFormat

        public static String toPDFFormat​(String date)
        Convert string representation of date to string representation of date in PDF format
        Parameters:
        date - passed date
        Returns:
        PDF string representation of passed date
      • toPDFFormat

        public static String toPDFFormat​(Calendar date)
        Convert Calendar date to string representation of date in PDF format
        Parameters:
        date - passed date
        Returns:
        PDF string representation of date