Reputation: 40814
Running it
SELECT timestamp '2019-6-2 00:00 UTC'
will return a date representation to me
then I want to obtain it as a bigint,
SELECT cast(timestamp '2019-6-2 00:00 UTC' as bigint)
I got this error
Query failed (#20190604_014249_16755_mru2t): line 1:8: Cannot cast timestamp with time zone to bigint
Upvotes: 0
Views: 128
Reputation: 1270713
What bigint do you want? One reasonable answer is a unix timestamp:
select cast(to_unixtime(timestamp '2019-6-2 00:00 UTC') as bigint)
Upvotes: 4