Problem with datetime data from mysql allways returned in utc coding and not local time Bug Report #1656668247093

OS info

  • Operating System : Windows 10.0.22621
  • Wappler Version : 5.0.0-beta.7

Problem description

Problem with datetime data from mysql allways returned in utc coding and not local time
I allways get a return of utc coded time when i use a sql to mysql. It show 2 hours wrong and it utc format. I have set local timezone in database connoction. And wappler is the only that returns utc code on the time

Steps to reproduce

1.select rom_id, start, stopp, tekst from bedrift_enkunde_ensted_rom_tider
where rom_id = :p1
2.
3.
I have to use this sql code to get he right time
select rom_id, date_format(start,’%d-%m-%Y %H:%I’), date_format(stopp,’%d-%m-%Y %H:%I’), tekst from bedrift_enkunde_ensted_rom_tider
where rom_id = :p1

Did you set a timzone in your project target settings?

Yes set to Europe /Oslo

What server model are you using? Node or PHP?

nodejs, and both development and production site is using the same database

Is this happening only on the beta or was this happening already before? I had the exact same issue and it was solved that’s why I’m wondering.

The problem was in both versions. I just checked that. I had to sett the timezone in database connection to UTC and not local. That fixed the problem with the time showing wrong time. But still I have that anoying Z and T in the database result.

I’m not sure if I understand your problem. What are you doing with your query? Are you using it for an insert or do you need it on the frontend?

In both cases you can use a formatter.

Yes, seem to be the only way