From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03030205.xhp | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03030205.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03030205.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03030205.xhp b/helpcontent2/source/text/sbasic/shared/03030205.xhp new file mode 100644 index 000000000..c351bf9fd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030205.xhp @@ -0,0 +1,76 @@ + + + + + + + TimeSerial Function + /text/sbasic/shared/03030205.xhp + + + + + + +
+ + TimeSerial function + + + +TimeSerial Function +Calculates a serial time value for the specified hour, minute, and second parameters that are passed as numeric value. You can then use this value to calculate the difference between times. +
+ +Syntax: + +TimeSerial (hour, minute, second) + + +Return value: +Date + +Parameters: + hour: Any integer expression that indicates the hour of the time that is used to determine the serial time value. Valid values: 0-23. + minute: Any integer expression that indicates the minute of the time that is used to determine the serial time value. In general, use values between 0 and 59. However, you can also use values that lie outside of this range, where the number of minutes influence the hour value. + second: Any integer expression that indicates the second of the time that is used to determine the serial time value. In general, you can use values between 0 and 59. However, you can also use values that lie outside of this range, where the number seconds influences the minute value. + Examples: +12, -5, 45 corresponds to 11, 55, 45 +12, 61, 45 corresponds to 13, 2, 45 +12, 20, -2 corresponds to 12, 19, 58 +12, 20, 63 corresponds to 12, 21, 4 +You can use the TimeSerial function to convert any time into a single value that you can use to calculate time differences. +The TimeSerial function returns the type Variant with VarType 7 (Date). This value is stored internally as a double-precision number between 0 and 0.9999999999. As opposed to the DateSerial or DateValue function, where the serial date values are calculated as days relative to a fixed date, you can calculate with values returned by the TimeSerial function, but you cannot evaluate them. +In the TimeValue function, you can pass a string as a parameter containing the time. For the TimeSerial function, however, you can pass the individual parameters (hour, minute, second) as separate numeric expressions. + + + +Example: + +Sub ExampleTimeSerial +Dim dDate As Double, sDate As String + dDate = TimeSerial(8,30,15) + sDate = TimeSerial(8,30,15) + MsgBox dDate,64,"Time as a number" + MsgBox sDate,64,"Formatted time" +End Sub + + + +
\ No newline at end of file -- cgit v1.2.3