Formats a TIMESTAMP value into a string. Supports timezone for accurate display.
STRINGDiperbarui: 13 Jun 2026FORMAT_TIMESTAMP(format_string, timestamp_expression [, time_zone])Format string with date, time, and timezone elements
The TIMESTAMP value to format
Timezone for display (default UTC)
1 SELECT 2 ts, 3 FORMAT_TIMESTAMP('%Y-%m-%d %H:%M:%S %Z', ts) as utc_format, 4 FORMAT_TIMESTAMP('%Y-%m-%d %H:%M:%S', ts, 'Asia/Jakarta') as jakarta_time 5 FROM UNNEST([TIMESTAMP '2024-01-15 10:00:00 UTC']) as ts;
Format a timestamp converted to different timezones.
| ts | utc_format | jakarta_time |
|---|---|---|
| 2024-01-15 10:00:00 UTC | 2024-01-15 10:00:00 UTC | 2024-01-15 17:00:00 |
1 SELECT 2 user_id, 3 FORMAT_TIMESTAMP('%d %B %Y, %H:%M', last_login, user_timezone) as last_seen 4 FROM `project.dataset.users`;
Display the last login time in the user's local timezone.
Sudah paham FORMAT_TIMESTAMP? Latih langsung di browser
Latihan interaktif, langsung di browser.