I have a website with multiple locales (English, Dutch, French, German and Spanish). I'm saving dates on a front-end form through Ajax, but it seems that Craft saves the dates in the locales' format, eg. in English, the 1st February 2018 would be 02/01/2018 and in Dutch it would be 01/02/2018.
I'd think Craft would save all dates in the same format, disregarding any locale. I read somewhere that craft saves all dates in UTC format.
When I'm in the locale EN and I pass the date 01/02/2018, expecting 2nd January 2018 to be saved, it saves OK. However, if I'm in NL, DE or FR and I pass the same date, it is saved as 1st February 2018 as these languages switch the day and month around.
I always pass MM/DD/YYYY
to the date field whatever locale.
I'm using the dateFns library for formatting and the date it formats is correct. I use VueJS v-calendar as a datepicker which also shows everything correct.
But when it's saved to Craft it suddenly switched day and month in the back-end!
Any help or explanation, please? Seems like strange behavior choices.