We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The result is incorrect when a timestamp with time zone <= UTC 00:00 is provided.
presto> select -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 +02:00'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 +01:00'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 +00:00'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 -01:00'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 -02:00'); _col0 | _col1 | _col2 | _col3 | _col4 ------------+------------+------------+------------+------------ 2020-02-29 | 2020-02-29 | 2020-03-01 | 2020-03-01 | 2020-03-01
This also affect last_day_of_month(current_timestamp), depends on the timezone of the client.
last_day_of_month(current_timestamp)
⇒ java -Duser.timezone=Asia/Tokyo -jar ./presto-cli-*-executable.jar presto> select -> current_timestamp, -> last_day_of_month(current_timestamp), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Asia/Tokyo'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Asia/Hong_Kong'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Australia/North'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 America/New_York'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 America/Los_Angeles'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Canada/Atlantic'); _col0 | _col1 | _col2 | _col3 | _col4 | _col5 | _col6 | _col7 ------------------------------------+------------+------------+------------+------------+------------+------------+------------ 2020-02-17 15:54:29.193 Asia/Tokyo | 2020-02-29 | 2020-02-29 | 2020-02-29 | 2020-02-29 | 2020-03-01 | 2020-03-01 | 2020-03-01 ⇒ java -Duser.timezone=America/Los_Angeles -jar ./presto-cli-*-executable.jar presto> select -> current_timestamp, -> last_day_of_month(current_timestamp), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Asia/Tokyo'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Asia/Hong_Kong'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Australia/North'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 America/New_York'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 America/Los_Angeles'), -> last_day_of_month(timestamp '2020-02-17 00:00:00.000 Canada/Atlantic'); _col0 | _col1 | _col2 | _col3 | _col4 | _col5 | _col6 | _col7 ---------------------------------------------+------------+------------+------------+------------+------------+------------+------------ 2020-02-16 22:54:56.653 America/Los_Angeles | 2020-03-01 | 2020-02-29 | 2020-02-29 | 2020-02-29 | 2020-03-01 | 2020-03-01 | 2020-03-01
The text was updated successfully, but these errors were encountered:
oneonestar
Successfully merging a pull request may close this issue.
The result is incorrect when a timestamp with time zone <= UTC 00:00 is provided.
This also affect
last_day_of_month(current_timestamp)
, depends on the timezone of the client.The text was updated successfully, but these errors were encountered: