Package db2000.J.eXtrafunctions
Class fTIMESTRING
- java.lang.Object
-
- db2000.J.eXtrafunctions.fTIMESTRING
-
public class fTIMESTRING extends Object
timestring functions
-
-
Constructor Summary
Constructors Constructor Description fTIMESTRING()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
AddTimestring(String xTimestring1, String xTimestring2, int xNrDigitsHour)
returns a timestring which is the sum of two timestringstatic long
DateTimestringDiff(String xDateTimestring1, String xDateTimestring2, String xInterval, boolean xAbsoluteValue)
returns a value corresponding to the number of time intervals between two datetimestringstatic String
GetSystemTime()
returns the system time ("hh:mm:ss")static String
GetTimestampFormat()
returns the timestamp format in use (default is "dd/MM/yyyy hh:mm:ss")static String
GetTimestringSeparator()
returns the timestring separator for outputstatic String
HoursToTimestring(long xHours, int xNrDigitsHour, boolean xDigitsMinutes, boolean xDigitsSeconds)
returns a timestring of the specified hoursstatic boolean
IsTimestring(String xTimestring, boolean xCheckDigitsHour)
returns [true] if the timestring is valid, otherwise [false]static String
MinutesToTimestring(long xMinutes, int xNrDigitsHour, boolean xDigitsSeconds)
returns a timestring of the specified minutesstatic String
NormalizeTimestring(String xTimestring, int xNrDigitsHour)
returns the timestring normalized ("xHH:MM:SS")static long[]
SecondsToMinutes(long xSeconds)
returns an array of two elements (minutes and the rest of seconds)static String
SecondsToTimestring(long xSeconds, int xNrDigitsHour)
returns a timestring of the specified secondsstatic void
SetTimestampFormat(String xTimestampFormat)
sets the timestamp formatstatic void
SetTimestringSeparator(String xTimeSeparator)
sets the timestring separator for outputstatic String
SubTimestring(String Timestring1, String Timestring2, int xNrDigitsHour)
returns a timestring which is the difference (subtraction) between two timestringstatic long
TimestringToHours(String xTimestring, long xRoundMinutes, long xRoundSeconds)
returns the hours from a timestringstatic long
TimestringToMinutes(String xTimestring, long xRoundSeconds)
returns the minutes from a timestringstatic long
TimestringToSeconds(String xTimestring)
returns the seconds from a timestring
-
-
-
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 1xDateTimestring2
- the datatimestring 2xInterval
- "y" = years, "m" = months, "d" days, "h" = hours, "n" = minutes, "s" = seconds, "!" = millisecondsxAbsoluteValue
- '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 convertedxNrDigitsHour
- the number of digits for displaying the hours fieldxDigitsMinutes
- = [true] the minutes field is included, otherwise nothingxDigitsSeconds
- = [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 convertedxNrDigitsHour
- the number of digits for displaying the hours fieldxDigitsSeconds
- = [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 normalizedxNrDigitsHour
- 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 convertedxNrDigitsHour
- 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 0xRoundSeconds
- 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
-
-