Seeing new Date/Time issues after upgrading old site

Using Node backend and MSSQL as the data base.

Just updated an older site to App Connect 2 on Wappler version 6.8.0. I don't know what version the site was on before but I'm seeing a lot of date/time issues now with this update. I have always formatted the date/time with removing the Z in the formatting to prevent any timezone issues, but this is the feed from the database. So for this one, I have a date in my database as 2024-09-13, but when I see it in the JSON feed it shows as 2024-9-12. Why does this happen with no formatters? All of this code has not changed, just the Wappler version.

Why does this happen and how can I fix it?

In the database:

In the JSON:

Here is an update. I compared the updated version with the old version and Wappler 6.8.0 is pulling the data over as a date field:
AppointmentDate: "2024-09-12"

But the old version (i am not sure what version but it is pre app connect 2.0 is pulling it over as a date/time field:
AppointmentDate: "2024-09-13T00:00:00.000Z"
With time zone information..

So nothing on this site has changed, except the wappler version. No code changes to these pages or the server actions but somewhere in the server action it is treating the date field differently. MSSQL server data base has that field as a date datatype, same as it has been for years. It does not matter to me, I'll format it but how to I pull that data from the database and it come over exactly as it is in the database before I apply any formatting? And.. it has no timezone data..

What can I do to return the data correctly?

Anyone, any ideas? Why does Wappler 6.8.0 treat the Date field from MS SQL server differently from the older version of Wappler? Is there anything I can do or is there a work-around?

I seem to recall an update where Node handled dates differently. Since I haven't used Node I kind of dismissed it.

I'm trying to find the thread where this was discussed but having no luck.

@teodor , any ideas?

1 Like
2 Likes

Thanks, that is the post I was trying to find for him.

Thank you Brad. I thought I remember seeing something on it a while back but could not find the tutorial either. I did find that setting but didn't think it made a difference. After looking at the thread, I went back and change it again and it appears to be working properly.
Thanks Teo for finding it. It's been a great help. Thanks to both of you.

2 Likes

Just a quick follow up.
Since this was an older site I was updating, I did have the Timezone Handling setting set to "Driver Dependent" which is what is suggested for older existing sites in the tutorial. I tried the other two different settings but while the "Driver Dependent" setting does work for timestamps, but it does not seem to work for dates, or rather datatypes in the database set as "Date". It does not bring over the timezone information that it does on the Timestamp datatype.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.