Skip to content
New issue

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

Dates not displaying correctly in tables vs text #52

Open
Bryon-Abbott opened this issue May 17, 2024 · 2 comments
Open

Dates not displaying correctly in tables vs text #52

Bryon-Abbott opened this issue May 17, 2024 · 2 comments

Comments

@Bryon-Abbott
Copy link

VSCode Mysql-Shell-Plugin Date Issues

I am experiencing an issues when displaying data via the mysql-shell-plugins associated with Date fields.

When data is displayed via a table in the mysql-shell-plugin, the dates displayed are a day earlier than the database.

I am guessing this is something to do with the Timezone default for VSCode or the mysql-plugin but not sure where to configure this?

Query via Terminal / mysql - OK

mysql> select * from aaExchangeRates where erDate between '2024-03-26' and '2024-04-05';
+------------+--------+---------+
| erDate     | erEUR  | erUSD   |
+------------+--------+---------+
| 2024-03-26 | 1.4711 | 1.35720 |
| 2024-03-27 | 1.4701 | 1.35870 |
| 2024-03-28 | 1.4632 | 1.35500 |
| 2024-04-01 | 1.4592 | 1.35740 |
| 2024-04-02 | 1.4609 | 1.35720 |
| 2024-04-03 | 1.4642 | 1.35370 |
| 2024-04-04 | 1.4666 | 1.35040 |
| 2024-04-05 | 1.4723 | 1.35980 |
+------------+--------+---------+
8 rows in set (0.00 sec)

mysql> 

Terminal Mysql Output - OK

Query via mysql-shell-plugin with Results as Text - OK

sql> select * from aaExchangeRates where erDate between '2024-03-26' and '2024-04-05' LIMIT 0, 1001;
+------------+--------+---------+
| erDate     | erEUR  | erUSD   |
+------------+--------+---------+
| 2024-03-26 | 1.4711 | 1.35720 |
| 2024-03-27 | 1.4701 | 1.35870 |
| 2024-03-28 | 1.4632 | 1.35500 |
| 2024-04-01 | 1.4592 | 1.35740 |
| 2024-04-02 | 1.4609 | 1.35720 |
| 2024-04-03 | 1.4642 | 1.35370 |
| 2024-04-04 | 1.4666 | 1.35040 |
| 2024-04-05 | 1.4723 | 1.35980 |
+------------+--------+---------+

VSCode Mysql Plugin Output - OK
Execute the block and print the results as text

Query via mysql-shell-plugin - Table vs Text - TABLE NOT-OK

When the same query is displayed as a table, the dates are displayed shifted 1 day earlier.
I also noticed that the display format has changed to a local format (MM/DD/YYYY) vs the default (YYYY-MM-DD)
Note the data is selected correctly according to the Where clause but displays as a day earlier.

VSCode-MySql-Issue-2

Here is the environment I am using.

  • OS: Linux Fedora 40
  • MySQL: Ver 8.4.0 for Linux on x86_64 (MySQL Community Server - GPL)
  • mysql-shell-plugins: v1.14.2
@mike-lischke
Copy link
Member

This is certainly a timezone issue, because midnight is used for TypeScript Date, if no explicit time is specified. Fortunately, this should be fixed in the upcoming release of the extension.

@Bryon-Abbott
Copy link
Author

Bryon-Abbott commented May 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants