When I run this test code on my development machine, it works as expected. CF9.01
I in Europe use the date format in euros, so September 10, 1957 - September 10, 1957.
<cfset testDate="10/09/1957"> <cfoutput> Initial string = "#testDate#"<br> LSparsedatetime output = #lsparsedatetime(session.form.patientDOB)#<br> parsedatetime output = #parsedatetime(session.form.patientDOB)# </cfoutput>
Test computer output
Initial string = "10/09/1957" LSparsedatetime output = {ts '1957-09-10 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'}
The same code output on a live server
Initial string = "10/09/1957" LSparsedatetime output = {ts '1957-10-09 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'}
Server OS - Windows Web Server 2008 R2. I checked the control panel> date and time and it is correctly installed in London. The web server is IIS7, but I donβt think it would affect anything?
IN region and Language, the location is set to United Kingdom and to Administrative (change the locale system), this is also true since English (United Kingdom)
Update: as far as CF is concerned, he believes that the server is in the US locale.
Launching this ...
<cfset testDate="10/09/1957"> <cfoutput> Initial string = "#testDate#"<br> #getLocale()#:<br> LSparsedatetime output = #lsparsedatetime(testDate)#<br> parsedatetime output = #parsedatetime(testDate)#<br> <P> <cfset SetLocale("en_GB") /> en_GB:<br> LSparsedatetime output = #lsparsedatetime(testDate)#<br> parsedatetime output = #parsedatetime(testDate)#<br> </cfoutput>
Gives this way out
Initial string = "10/09/1957" English (US): LSparsedatetime output = {ts '1957-10-09 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'} en_GB: LSparsedatetime output = {ts '1957-09-10 00:00:00'} parsedatetime output = {ts '1957-10-09 00:00:00'}
But here is the confirmation of the server settings.


Forced localization with setLocale in code eliminates the correct behavior.