简体   繁体   中英

Date format in Google Cloud Storage changes date to YYYY-DD-MM format

I upload data to Google Cloud Storage from CSV. The data in CSV is in dd/mm/yyyy format (in my example it is 05/09/2022 or 5th of September) and according to the metadata settings, I can see the default date is mm/dd/yyyy and it reads the date as 9th of May. How can I solve this issue and make GCP to read the date in dd/mm/yyyy format? 在此处输入图像描述

You can do this at the query level only. There is no way to change the format directly.

Also as mentioned above in comments, the custom time field does not represent the date format of the underlying data. You can refer to this document .

According to the documentation ,format string represents the textual form of date and time and contains separate format elements that are applied left-to-right. Load the csv with all date columns as string, and parse them manually as date in a query.

Additionally you can check this stackoverflow link1 & link2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM