Formats a TIME value into a string based on the specified format.
STRINGDiperbarui: 13 Jun 2026FORMAT_TIME(format_string, time_expression)Format string with elements such as %H, %M, %S
The TIME value to format
1 SELECT 2 time, 3 FORMAT_TIME('%H:%M:%S', time) as time_24h, 4 FORMAT_TIME('%I:%M %p', time) as time_12h, 5 FORMAT_TIME('%H.%M', time) as compact 6 FROM UNNEST([TIME '14:30:45']) as time;
Format a time value using various format patterns.
| time | time_24h | time_12h | compact |
|---|---|---|---|
| 14:30:45 | 14:30:45 | 02:30 PM | 14.30 |
1 SELECT 2 event_name, 3 FORMAT_TIME('%H:%M', start_time) as starts, 4 FORMAT_TIME('%H:%M', end_time) as ends 5 FROM `project.dataset.schedule`;
Format event schedule start and end times.
Sudah paham FORMAT_TIME? Latih langsung di browser
Latihan interaktif, langsung di browser.