Converting a String Type to a Time Type (PAR 68119)
When converting a String primitive type to a Time primitive type, the valid time string is now as follows.
hh:mm[:ss.fff] [pre‑or‑post‑noon‑indicator]
This string is converted to Time. The rules that apply when casting a string to a time are as follows.
-
The delimiter between time elements is a single non‑alphanumeric characters.
-
The hour element must be numeric in the range 0 through 24 (inclusive).
-
The minute and second elements must be numeric in the range 0 through 59 (inclusive).
-
The millisecond element must be numeric in the range 0 through 999 (inclusive).
-
A term specifying pre- or post-noon (that is, case‑insensitive "am", "a.m.", "pm", or "p.m.") is valid only if the hour element is less than or equal to 12.
-
"12:00 a.m.".Time converts to 00:00:00.
-
"12:00 p.m.".Time converts to 12:00:00.