Hey all,
I’m putting together a schedule of games and one error I’m running into is that the dates of games is off.
For example, here are the dates in my data. I exported from a CSV from Google Sheets.
But once I publish and link to the table, it takes off a day for some reason.
Not sure if it’s a me issue or a server issue or something else.
No, it’s a time zone issue. Wix dates are stored in UTC ±0. When your location is earlier, the frontend (thus Wix Content Manager) takes browser locale into account to display a date according to your time zone, subtracts the time zone difference and displays a new date, in your case a couple of hours earlier, which crossed the time zone, so the date gets lowered as well.
That’s good to know! Is there a way to alter that? Or should I manually add the dates?
The amount of work you need to do depends completely on the amount of different time zones you expect input from. If that is only 1, and you are in the same time zone as where the input is coming from, then new input will not bee a problem.
The discrepancy you noticed stems from the fact that you PROBABLY converted a date without the time part into Wix. So it gets set to zero. Then your browser looks at where you are and displays the date for your time zone.
So basically, if that is the problem, import again with a date which holds the time, or manually update every date in CM or write a short program that does it for you if there are many rows.
Just remember that JS-dates are basically an amount of milliseconds passed since Jan 1, 1970, UTC +0. Thus, a JS-date ALWAYS consists of a day and a time part. It’s the latter that always leads to the problem you encountered.