Hello ,
I have a strange problem with dates. When I take a date from DatePicker in Front end page it shows date as Thu May 21 2020 00:00:00 GMT+0300 (Eastern European Summer Time)
Then When I transfer the same variable to backend function and print into console same variable it shows : 2020-05-20T21:00:00.000Z
Can someone help me how to make them equal ?
No fix from Wix? I am having the same problem. I don’t know where to parse since the date format showing on the console is the thing that I want, but on the backend data its different and shows a yellow mark telling its invalid format.
There are different time-formats you can use.
In general, when working with times → you probably should work with → TIMESTAMPS ← do the calculation and convert it to the time-format of your choice after calculation.
Also you maybe want first to check what kind of format is setted up inside of your database. As long as you did not setted-up the format of a DB-Field it will get the yellow WARNING-SIGN inside of your DB.
Also read the following post …
…or this one…
…or this one…
…and this one…
Convert your date to the right format, which is expected by your DATABASE.
Thank you @CODE-NINJA I’m reading it and somehow its similar in a way he puts the input values on his collection.
I was assuming that since it’s Wix’s datepicker element, it should automatically be the date format on the CMS collection when the data type “Date” is used. Coding it on the front-end to save the datepicker selected value to the CMS should not be the issue.
I’ll get back to you after reading your link and will try to do some tricks and I hope it works.