I would like to query a JSON object containing a MySQL TIMESTAMP named 'time':
SELECT time, JSON_OBJECT('t', time, 'v', value) AS value FROM values
But unfortunately, MySQL transforms the ISO 8601 formatted timestamp "2019-04-04T12:00:00.000Z" automatically into this presentation "2019-04-04 12:00:00.000000". See the following response:
{
"time": "2019-04-04T12:00:00.000Z",
"value": {
"t": "2019-04-04 12:00:00.000000",
"v": 30
}
}
Is it possible to access time keeping its original type and presentation (as "2019-04-04T12:00:00.000Z") inside a JSON object? What is the recommended and clean approach to this?