I am developing an application with Xamarin.Forms that communicates with my REST API made in Node.js and it communicates with my database in phpmyadmin. (All the development is in local).
The problem I have is that when I send the JSON data and I see with a console.log()
what is sent I see that the date is correct.
2018-05-16T00: 00: 00 + 02: 00
Then when checking from phpymyadmin that the data has been saved well I see that it is a day less. (The field is a DATE).
Also when I want to receive the data from my database before sending it to me I have checked with a console.log()
and it returns this date format with one day less:
2018-05-15T22: 00: 00.000Z
When I deserialize the JSON and see it with Debug.WriteLine (date) it shows me this other type of date:
5/15/2018 10:00:00 PM +00: 00
- I have checked from Visual Studio with Debug.WriteLine (date.Kind) when sending and receiving to know if they are UTC or Local and in both cases they are Local.
- I have configured the timezone with process.env.TZ = 'Europe / Madrid' in Node.js.
- I have changed the timezone of php.ini just in case and also MySQL from console I have tried these sentences:
MariaDB [(none)]> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2018-05-16 22:40:27 |
+---------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+
1 row in set (0.00 sec)