Class fTIMESTRING


  • public class fTIMESTRING
    extends Object
    timestring functions
    • Constructor Detail

      • fTIMESTRING

        public fTIMESTRING()
    • Method Detail

      • GetSystemTime

        public static String GetSystemTime()
        returns the system time ("hh:mm:ss")
      • AddTimestring

        public static String AddTimestring​(String xTimestring1,
                                           String xTimestring2,
                                           int xNrDigitsHour)
        returns a timestring which is the sum of two timestring
        Parameters:
        xTimestring1 - "xHH:MM:SS" (eg. "252:03:08")
        xTimestring2 - "xHH:MM:SS" (eg. "03:06:52")
        xNrDigitsHour - the number of digits for displaying the hours field
      • DateTimestringDiff

        public static long DateTimestringDiff​(String xDateTimestring1,
                                              String xDateTimestring2,
                                              String xInterval,
                                              boolean xAbsoluteValue)
        returns a value corresponding to the number of time intervals between two datetimestring
        Parameters:
        xDateTimestring1 - the datatimestring 1
        xDateTimestring2 - the datatimestring 2
        xInterval - "y" = years, "m" = months, "d" days, "h" = hours, "n" = minutes, "s" = seconds, "!" = milliseconds
        xAbsoluteValue - 'true' = absolute value, 'false' = none
      • GetTimestampFormat

        public static String GetTimestampFormat()
        returns the timestamp format in use (default is "dd/MM/yyyy hh:mm:ss")
      • GetTimestringSeparator

        public static String GetTimestringSeparator()
        returns the timestring separator for output
      • HoursToTimestring

        public static String HoursToTimestring​(long xHours,
                                               int xNrDigitsHour,
                                               boolean xDigitsMinutes,
                                               boolean xDigitsSeconds)
        returns a timestring of the specified hours
        Parameters:
        xHours - the hours to be converted
        xNrDigitsHour - the number of digits for displaying the hours field
        xDigitsMinutes - = [true] the minutes field is included, otherwise nothing
        xDigitsSeconds - = [true] the seconds field is included, otherwise nothing
      • IsTimestring

        public static boolean IsTimestring​(String xTimestring,
                                           boolean xCheckDigitsHour)
        returns [true] if the timestring is valid, otherwise [false]
      • MinutesToTimestring

        public static String MinutesToTimestring​(long xMinutes,
                                                 int xNrDigitsHour,
                                                 boolean xDigitsSeconds)
        returns a timestring of the specified minutes
        Parameters:
        xMinutes - the minutes to be converted
        xNrDigitsHour - the number of digits for displaying the hours field
        xDigitsSeconds - = [true] the seconds field is included, otherwise nothing
      • NormalizeTimestring

        public static String NormalizeTimestring​(String xTimestring,
                                                 int xNrDigitsHour)
        returns the timestring normalized ("xHH:MM:SS")
        Parameters:
        xTimestring - the timestring to be normalized
        xNrDigitsHour - the number of digits for displaying the hours field
      • SecondsToMinutes

        public static long[] SecondsToMinutes​(long xSeconds)
        returns an array of two elements (minutes and the rest of seconds)
      • SecondsToTimestring

        public static String SecondsToTimestring​(long xSeconds,
                                                 int xNrDigitsHour)
        returns a timestring of the specified seconds
        Parameters:
        xSeconds - the seconds to be converted
        xNrDigitsHour - the number of digits for displaying the hours field
      • SetTimestampFormat

        public static void SetTimestampFormat​(String xTimestampFormat)
        sets the timestamp format
        Parameters:
        xTimestampFormat - the timestamp format (eg. "dd/MM/yyyy hh:mm:ss")
      • SetTimestringSeparator

        public static void SetTimestringSeparator​(String xTimeSeparator)
        sets the timestring separator for output
      • SubTimestring

        public static String SubTimestring​(String Timestring1,
                                           String Timestring2,
                                           int xNrDigitsHour)
        returns a timestring which is the difference (subtraction) between two timestring
        Parameters:
        xTimestring1 - "xHH:MM:SS" (eg. "256:00:00")
        xTimestring2 - "xHH:MM:SS" (eg. "252:03:08")
        xNrDigitsHour - the number of digits for displaying the hours field
      • TimestringToHours

        public static long TimestringToHours​(String xTimestring,
                                             long xRoundMinutes,
                                             long xRoundSeconds)
        returns the hours from a timestring
        Parameters:
        xTimestring1 - "xHH:MM:SS" (eg. "13:31:27")
        xRoundMinutes - increment of one hour if >= of the timestring minutes, the minutes are set to 0
        xRoundSeconds - increment of one minute if >= of the timestring seconds, the seconds are set to 0
      • TimestringToMinutes

        public static long TimestringToMinutes​(String xTimestring,
                                               long xRoundSeconds)
        returns the minutes from a timestring
        Parameters:
        xTimestring1 - "xHH:MM:SS" (eg. "08:25:43")
        xRoundSeconds - increment of one minute if >= of the timestring seconds, the seconds are set to 0
      • TimestringToSeconds

        public static long TimestringToSeconds​(String xTimestring)
        returns the seconds from a timestring