问题
Is there a date or datetime data type in Google BigQuery? I looked at the online documentation, but the data types mentioned didn't include any date types
回答1:
2013 update:
BigQuery now has a Timestamp type.
Look at: BigQuery datatypes
2018: TIMESTAMP, TIME, DATE, DATETIME
回答2:
2016 update:
BigQuery now also has real DATE type (in addition to TIMESTAMP type) in standard SQL:
https://cloud.google.com/bigquery/sql-reference/data-types#date-type https://cloud.google.com/bigquery/sql-reference/functions-and-operators#date
回答3:
Edited to add: There is a date time type, see Fh's answer for more information.
No date data type is available, although if you use ISO-formatted date-times (YYYY-MM-DD HH:MM:SS[.uuuuuu]) or timestamps (convertable to microseconds since 1970) there are a number of date functions that you can use. See this page for more information.
来源:https://stackoverflow.com/questions/12219885/google-bigquery-date-data-type