For production servers (web and DB), yes. Dev and local servers - yes and no.
I am not sure if we have dealt with just date field in quite some time. We usually always have datetime/timestamp field which needs the timezone handling.
In current setup, all values stored in DB are UTC.
What this helps with is when querying it back from DB, “Z” was already added. So just applying the date time formatter in client side would mean Wappler converts it to local time, and the user will see the the timestamp in their timezone.
I don’t think Wappler has any official doc around handling timezone setup yet. So if you guys could give us some flow around this - how best to handle custom timezone using Wappler - with the changes you are planning here, it would be great.
From what I can think of, there are many parts of it to handle. Few of them Ken has pointed out.
Here;s my suggestion:
- Do not change anything related to timestamp values to-and-from DB queries on the server action side.
- Let the dev handle the date conversion on client side using new/more-robust formatters - convert to local, convert using offset value etc.
- Same formatters could be made available on server side to manipulate such values sent from client side and store in DB reliably as UTC or as-is, as the dev wants.
- I would also like to suggest to remove the functionality where applying
formatDate
converts timestamp to local value automatically.
I understand that this will require more formatters to be applied on client side and might affect JS performance, but at least it will be consistent in the behaviour.