TIMEVALUE(time)

Returns the time given a string representation of a time (Date).


timeThe time as a string (String).

REMARKS
* If "time" is Null, then Null is returned.
* If "time" includes date information, then the date information is ignored.
* If "time" includes any invalid date or time information, then an error occurs. Type Mismatch.
* This function recognises both 12-hour and 24-hour clock. For example, "2:24PM" and "14:24".
* This function recognises dates according to the DATEVALUE function.
* The equivalent .NET function is Microsoft.VisualBasic.DateAndTime.TimeValue
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print TimeValue("4:35:17 PM") = ?? 
Debug.Print TimeValue("12:30") = "12:30:00"
Debug.Print TimeValue(Time()) = 16:36:53
Debug.Print TimeValue(Now()) = 16:36:53
Debug.Print TimeValue(Time() + 1) = 16:36:53
Debug.Print TimeValue(Time() + 0.5) = 04:36:53
Debug.Print TimeValue(Time() + (1 / 24)) = 17:36:53
Debug.Print TimeValue(Time() + 2) = 16:36:53
Debug.Print TimeValue("12:90:30" = Error 13 ' 90 minutes
Debug.Print TimeValue("29/2/2000 12:30:30") = Error 13 ' 2000 is a leap year

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top