0

I realized a big problem when migrating my bank from an Ubuntu server to another Google SQL Cloud server.

Right after importing my bank the date of the first registration looks like this: 2018-01-31

In the settings of DBearver and I go to Data Formatting and make the changes to pt - Portuguese, at that exact moment the date of the first record that was 2018-01-31 after changing the date format it changes to 2018-01-30, being that the correct one would be 31-01-2018.

Before configuration:

Before configuration

After setup:

After setup

So changes all future records to the current date, has anyone noticed this detail or have an idea how to resolve?

Jarciano
  • 53
  • 8
  • Your new database has the right dateformat for mysql like 2018-01-31, use in your Select statement DATE_FORMAT tp display how you like it – nbk Jan 27 '20 at 19:53
  • I recall reading this bizarre post once.. https://stackoverflow.com/questions/6841333/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result/6841479#6841479 - Could it be related? – JGFMK Jan 27 '20 at 20:25
  • What would this DATE_FORMAT configuration look like? I believe not, because data are very recent. – Jarciano Jan 28 '20 at 19:06

1 Answers1

1

I managed to solve it, Cloud SQL defines a system time as UTC.

So I set the time zone for my direct choice through the Google SQL dashboard with a statement like:

'UTC-03: 00'

To see what configuration is in your bank you can see the variables active in the bank:

SHOW VARIABLES;
Jarciano
  • 53
  • 8