Unparseable date

0
Hi,  I am parsing the Current Date and Time using this : parseDateTime(formatDate([%CurrentDateTime%]),'MM/dd/yyyy') It is working fine , but on few occassions , I am getting “Unparseable date” error.  I am getting this error on switching between languages. Is there any remedy to this problem?  Please help.
asked
1 answers
2

formatDate uses the users calendar, so if you are in the US you are probably getting MM/dd/yyyy, but elsewhere you could be getting dd/MM/yyyy.

https://docs.mendix.com/refguide/parse-and-format-date-function-calls/#5-formatdateutc

It would be best to use formatDateTime to ensure you get the date in the same format each time. For example,

 

parseDateTime(formatDateTime([%CurrentDateTime%],'MM/dd/yyyy'),'MM/dd/yyyy')


I hope this helps.

answered