starrocks
starrocks copied to clipboard
from_unixtime function return error results when using different format
Steps to reproduce the behavior (Required)
select from_unixtime(1727193600, 'yyyy-MM-dd HH:mm');
Expected behavior (Required)
select from_unixtime(1727193600, '%Y-%m-%d %H:%i');
+---------------------------------------------+
| from_unixtime(1727193600, '%Y-%m-%d %H:%i') |
+---------------------------------------------+
| 2024-09-25 00:00 |
+---------------------------------------------+
Real behavior (Required)
select from_unixtime(1727193600, 'yyyy-MM-dd HH:mm');
+-----------------------------------------------+
| from_unixtime(1727193600, 'yyyy-MM-dd HH:mm') |
+-----------------------------------------------+
| yyyy-MM-dd HH:mm |
+-----------------------------------------------+
StarRocks version (Required)
- You can get the StarRocks version by executing SQL
select current_version()
3.3
@zhangyifan27 most probably it seems you have not configured the correct time zone, so you are seeing incorrect result.
@zhangyifan27 most probably it seems you have not configured the correct time zone, so you are seeing incorrect result.
@rohitrs1983 When I changed the format string, second parameter of the function from_unixtime, the result is not expected. It returned the format string instead of the time string. I think it should be an implementation bug.
We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!