From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03030206.xhp | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03030206.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03030206.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03030206.xhp b/helpcontent2/source/text/sbasic/shared/03030206.xhp new file mode 100644 index 000000000..baf4ee9ea --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030206.xhp @@ -0,0 +1,78 @@ + + + + + + + TimeValue Function + /text/sbasic/shared/03030206.xhp + + + + + + +
+ + TimeValue function + + + +TimeValue Function +Calculates a serial time value from the specified hour, minute, and second - parameters passed as strings - that represents the time in a single numeric value. This value can be used to calculate the difference between times. +
+ +Syntax: + +TimeValue (Text As String) + + +Return value: +Date + +Parameters: + Text: Any string expression that contains the time that you want to calculate in the format "HH:MM:SS". +Use the TimeValue function to convert any time into a single value, so that you can calculate time differences. +This TimeValue function returns the type Variant with VarType 7 (Date), and stores this value internally as a double-precision number between 0 and 0.9999999999. +As opposed to the DateSerial or the DateValue function, where serial date values result in days relative to a fixed date, you can calculate with the values that are returned by the TimeValue function, but you cannot evaluate them. +In the TimeSerial function, you can pass individual parameters (hour, minute, second) as separate numeric expressions. For the TimeValue function, however, you can pass a string as a parameter containing the time. + + + + +Example: + +Sub ExampleTimerValue +Dim daDT As Date +Dim a1, b1, c1, a2, b2, c2 As String + a1 = "start time" + b1 = "end time" + c1 = "total time" + a2 = "8:34" + b2 = "18:12" + daDT = TimeValue(b2) - TimeValue(a2) + c2 = a1 & ": " & a2 & chr(13) + c2 = c2 & b1 & ": " & b2 & chr(13) + c2 = c2 & c1 & ": " & trim(Str(Hour(daDT))) & ":" & trim(Str(Minute(daDT))) & ":" & trim(Str(Second(daDT))) + MsgBox c2 +End Sub + + + +
\ No newline at end of file -- cgit v1.2.3