In bigquery, can you specify a language when using format_date - Localization in date functions

Viewed 409

I can't find a way to format a date in GCP bigquery using a specific language:

select CONCAT(FORMAT_DATE("Semaine du %d %B au ", date_trunc(current_date(),ISOWEEK)),FORMAT_DATE("%d %B", date_trunc(DATE_ADD(current_date(),INTERVAL 7 DAY),WEEK)))

It renders "Semaine du 17 May au 23 May", meaning "week from XX to XX" but in French.

I would like to be able to set the month names in french but can't find how to set that explicitly in FORMAT_DATE function? Is it possible?

1 Answers

BigQuery doesn't provide you localization options for Date Functions.

The solution is to use a short function to replace common names, which are very limited from English to the language of your choice. The function can be reused.

Related