bugsyb
bugsyb

Reputation: 6051

Convert Timestamp to DateTime in SQL (Google Big Query)

I'm trying to figure out how to convert a timestamp into a datetime object in SQL (I'm using Google Big Query).

Here's what the timestamp column looks like — each row contains a 10 digit integer.

Any help would be appreciated!

enter image description here

Upvotes: 0

Views: 1360

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269763

You want timestamp_seconds():

select timestamp_seconds(time_stamp) as utc_timestamp

Your column looks like a Unix timestamp, which is the number of seconds since 1970-01-01.

Upvotes: 2

Related Questions