LibreOffice 25.2 Help
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.
TimeValue (āļ´āˇāˇ
String āļŊāˇāˇ)
āļ¯āˇāļąāļē
āļ´āˇāˇ : āļāļļāļ§ "HH:MM:SS" āˇāˇāļŠāļāļŊāļēāˇāļąāˇ āļāļĢāļąāļē āļāˇāļģāˇāļ¸āļ§ āļ āˇāˇāˇâāļē āļāˇāļŊāļē āļ āļŠāļāļāˇ āļāļąāˇāļ¸ āļ āļąāˇ āļŊāļāˇāļĢāˇ āˇāˇāļŊāˇ āļ´āˇâāļģāļāˇāˇāļąāļēāļāˇ.
āļāļļāļ§ āļāˇāļŊ āˇāˇāļąāˇ āļāļĢāļąāļē āļāļŊ āˇāˇāļāˇ āˇāļą āļ´āļģāˇāļ¯āˇ āļāļąāˇāļ¸ āļāˇāļŊāļēāļāˇ āļāļąāˇ āļ āļāļēāļāļ§ āļ´āļģāˇāˇāļģāˇāļāļąāļē āļāˇāļģāˇāļ¸āļ§ TimeValue āļāˇâāļģāˇāļēāˇāˇ āļˇāˇāˇāˇāļāˇ āļāļģāļąāˇāļą.
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.
Sub ExampleTimerValue
Dim daDT As Date
Dim a1, b1, c1, a2, b2, c2 As String
a1 = "āļāļģāļ¸āˇāļˇāļ āļāˇāļŊāļē"
b1 = "āļ
āˇāˇāˇāļą āļāˇāļŊāļē"
c1 = "āļ¸āˇāˇ
āˇ āļāˇāļŊāļē"
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