Parameters
- value
- The string that is to be converted into a TdTime.
Exception | Description |
---|---|
System.ArgumentNullException | Value is a null reference. |
System.FormatException | Value does not contain a valid representation of a time. |
The string is parsed using the culture information contained in the specified Globalization.DateTimeFormatInfo object.
If the time contains sub-seconds, the separator that must be used in the string is a decimal point ("."). For example, in the string "10:21:22.2321" the sub-seconds is separated from the number of seconds using a decimal point.
When the value is parsed the TdTime.Scale will be set to the number of digits in the sub-seconds component (digits that are to the right of the decimal point). Therefore, a TdTime of "12:32:11.0000" will have a Scale of 4, and "23:43:22.121000" will have a scale of 6.
An attempt is made to avoid throwing a FormatException. Any unrecognized characters in the string will be ignored. An exception to this is the case when the number of digits to the right of the decimal point exceed the maximum scale of 6. If the number of digits exceed the maximum scale, a FormatException will get thrown. Trailing zeroes are ignored.
However, when a custom culture is used it is possible that the Parse will fail. A times string that contains custom culture specific date elements is very difficult to parse. The string may not match any of the implicit patterns that are used to parse a string.
If the value contains the string "NULL" a TdTime.Null will be returned.
Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019