Good day
I am trying to build an add-in that can handle values from and into a MySQL database the same way regardless of the Windows Region settings.
When the region settings has set the Short Date as "dd MMM yyyy" I have no idea how to change that format into "dd/mm/yyyy"
When I use:
Format(Date, "dd/mm/yyyy")
It translates to: 05 06 2020
Which errors out on the database. I have tried CDate and DateSerial, all to no avail.
I essentially set my Global Const variable called dateFormat as:
Public Const dateFormat = "dd/mm/yyyy"
And then I use the following to try and write to values into the Textboxes I use:
txtCreated.Value = Format(Date, dateFormat)
But the Textbox then contains the value as: 05 06 2020
When writing this value into my db, I use:
rs!ncreate = Format(txtCreated.Value, dateFormat)
And then get a date formatting error saying the format "dd mm yyyy" is not accepted even though I am trying to send it in format "dd/mm/yyy"
Any ideas?
/is the date separator but: The actual character used as the date separator in formatted output is determined by your system settings.\per the previously mentioned documentation to display the/as a literal character?