Class TimeUtils


  • public final class TimeUtils
    extends java.lang.Object
    A Utility class that deals with time.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  TimeUtils.Task
      A sample task to be executed.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TimeUtils()  
    • Constructor Detail

      • TimeUtils

        private TimeUtils()
    • Method Detail

      • formatTimeInLocalOrSpecifiedTimeZone

        public static java.lang.String formatTimeInLocalOrSpecifiedTimeZone​(long timeInMilliSeconds,
                                                                            java.lang.String format)
        Parameters:
        timeInMilliSeconds - - The time in milliseconds
        format - - A format that can be used by SimpleDateFormat
        Returns:
        - A formatted string representation of the time in the timezone as obtained via RuntimeBehavior.getTimeZone()
      • computeAndShowTime

        public static void computeAndShowTime​(java.lang.String msg,
                                              TimeUtils.Task task)
        Helper method that can be used to compute the time.
        Parameters:
        msg - - A user friendly message to be shown in the logs.
        task - - A TimeUtils.Task that represents the task to be executed.