Class TimeConverter


  • public class TimeConverter
    extends java.lang.Object
    Utility class for date conversion.
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeConverter​(long gmtMillis)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Date getLocalDate()
      Converts the date to local time.
      java.lang.String getLocalDateTimeString​(int dateFormat, int timeFormat)
      Creates a string representing the date and time for the local time zone.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimeConverter

        public TimeConverter​(long gmtMillis)
        Constructor.
        Parameters:
        gmtMillis - date to convert in milliseconds (GMT)
    • Method Detail

      • getLocalDate

        public java.util.Date getLocalDate()
        Converts the date to local time.
        Returns:
        local time
      • getLocalDateTimeString

        public java.lang.String getLocalDateTimeString​(int dateFormat,
                                                       int timeFormat)
        Creates a string representing the date and time for the local time zone.
        Parameters:
        dateFormat - format of date part as specified by DateFormat
        timeFormat - format of time part as specified by DateFormat
        Returns:
        dateTime string