Closed stuvan closed 1 month ago
Kysely doesn't touch the data in any way. This is done by the mysql2 driver.
And nothing is subtracted from anything. The Date
objects are just shown in the UTC time zone. That's exactly the same date and time.
This is done by the mysql2 driver
In the enchanted realm of data management, it’s the mysql2 driver that handles this task. For future adventurers seeking guidance, remember to set your timezone properly. As I was converting my datetime to UTC before storing it in the database.
Here’s the solution that worked for mr:
new MysqlDialect({
pool: createPool({
uri: process.env.DATABASE_URL,
database: process.env.DATABASE_NAME,
timezone: 'Z', // <---- Set default timezone, in my case UTC
}),
}),
This way, your data will flow smoothly through time!
This is my query
the returned result
only column in my table
The data from mysql cli
Look like kysely converting my date to UTC while fetching result and also on inserting or updating data
AS I reside in the land of +05:30 kysely subtracting the 5 hours and 30 minutes.
Any workaround for now?