1

Getting the error

Query Failed
Error: Invalid time zone: +0000

Is there a way to ignore time zones or default everything to UCT This is my where condition

WHERE TIMESTAMP(FORMAT_TIMESTAMP("%Y-%m-%d %H:%M:%E6S%z", PARSE_TIMESTAMP("%Y%m%d", date )),"UCT") = TIMESTAMP('2018-03-05 00:00',"UCT")

date column is string in this format 20180307

0

2 Answers 2

1

Community wiki answer originally left by the question asker as a comment:

The fix was removing the timestamp formatting from FORMAT_TIMESTAMP

TIMESTAMP(FORMAT_TIMESTAMP("%Y-%m-%d", PARSE_TIMESTAMP("%Y%m%d", ga.date )))
-1

You're specifying UCT, an invalid time zone as it is a misspelling. The time zone you are looking for is UTC.

Incorrect:

... TIMESTAMP('2018-03-05 00:00',"UCT")

Correct:

... TIMESTAMP('2018-03-05 00:00',"UTC")
3
  • Both fail and both are supported cloud.google.com/dataprep/docs/html/…
    – davey
    Commented Mar 7, 2018 at 14:11
  • Since it is a string, does your date column have any references to other time zones other than UCT, or is it purely an integer as you describe e.g. 20180307? Is it uniformly 8 characters? It would be interesting to see if your format doesn't strictly adhere to this. I would search for your localized time zone. SELECT date FROM project.dataset.table WHERE date LIKE '%servertimehere%' Commented Mar 7, 2018 at 14:23
  • They are all length 8
    – davey
    Commented Mar 7, 2018 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.