troubleshooting
How to get CURRENT_DATE in risingwave SQL query?
I want to know how to retrieve the current date in a risingwave SQL query. Xiangjin Wu mentioned using now()::date
in a batch query, but also provided options for getting the current date at a specific location. What are the different ways to get the current date in risingwave SQL queries?
Su
Sumit Singh
Asked on Jan 29, 2024
-
To get the current date in risingwave SQL query, you can use
now()::date
. This will return the current date in UTC timezone. -
If you want to get the current date at a specific location, you can use the following queries:
select (now() AT TIME ZONE 'US/Pacific')::date;
set timezone = 'US/Pacific'; select now()::date;
-
Note that setting the timezone using
set timezone
affects all future statements within the same session, but does not impact other sessions.
Jan 29, 2024Edited by