My bigquery table has a column which is of below format
23:00 19:00 15:00
and I want to convert them to time format(AM/PM)
11:00 PM 07:00 PM 03:00 PM
Thanks in advance!!
My bigquery table has a column which is of below format
23:00 19:00 15:00
and I want to convert them to time format(AM/PM)
11:00 PM 07:00 PM 03:00 PM
Thanks in advance!!
Use parse_time and format_time:
select format_time('%I:%M %p', parse_time('%H:%M', '23:00'))
Try:
with mytable as (
select '23:00' as column1 union all
select '19:00' as column1 union all
select '15:00' as column1
)
select format_time('%I:%M %p', parse_time('%H:%M', column1))
from mytable