#chen-sigma
1 messages · Page 1 of 1 (latest)
Hi koopajah! thanks for checking.
Okay so overall it works fine for me, it's just that you expect sigma to display the full / exact time like the hour/minute/second and it doesn't by default it just shows the day
so SELECT EXTRACT(HOUR FROM created), EXTRACT(HOUR FROM created AT TIME ZONE 'America/Los_Angeles') FROM subscriptions limit 3 should show you the difference with the hour localized, if that makes sense
and so you likely need to format the timestamp to your liking
sure thing!
Is there a way to extract the date? Or I need to plus/minus the date based on the hour extracted?
not entirely sure what you mean
the column is a timestamp, so you can use date format methods to display the info you want
thanks for the suggestion. Ultimately I want to display the date in PST. The line I'm writing now is date(created) - interval extract(hour from created AT TIME ZONE 'America/Los_Angeles') hour,, which is giving me syntax error.
@tranquil flare what syntax error do you get? Sorry we don't really write Sigma queries here but it's just normal SQL and I don't grasp what you are trying to do and why you remove an interval extract, like I don't grasp what the end goal is
the end goal is to display subscriptions' creation dates in PST. right now some dates are one day off because of the time zone difference.
Okay, so have you tried formatting the date to show exact yyyy-mm-dd hh:mm:ss first?
It seems the default output of created is e.g. 2021-09-16 17:23 +0000. I think having date, hour and minutes would be enough to know which day in PST it is.
ok I think this worked: date(at_timezone(created, 'America/Los_Angeles')),
ah awesome glad you figured it out