I am very sure the server configuration is set the New
Zealand region with DD/MM/YYYY.
I didn't store the date as string, I store it as a date/time
data type, but i pass in the input as a string to the
createODBCDatetime and the cfqueryparam.
The date is input by using date picker. so there is not user
input here. user must select the date from the date picker.
here is an example.
We have a form text field call dtStart, this field is
populated by a date picker. When the user click on a date, the date
picker will populate the date in DD/MM/YYYY, for example, 1 April
2008, will become 01/04/2008.
After the user submit, and i output the text field to the
screen, which show 01/04/2008. Now here is the problems.
if i try to use the #createODBCDateTime(FORM.dtStart)# to
output it to the screen and insert to the database, or use the
cfqueryparam to insert to the databas. There is a random chance
that it will show up as 4 January 2008 on the screen and in the
database.
If i try again by trying to correct it by reformat date
string using createDate function during the second try, because the
createDate is returning a date object, and i pass this time object
to either the createODBCDateTime or cfqueryparam, then it will show
up as 1 April 2008.
Now, i try the third time, this time i didn't use the
createDate function to convert the date string to date object. I
pass the date string directly to the createodbcDate and
cfqueryparam. Then it will show up as 1 April 2008 (instead of 4
January 2008 in the first try).
Please note, all 3 tries are happen in same session.
As i mention before, this problem doesn't happen very often,
and doesn't happen on the same date too. For example, if i try this
example again in few weeks later. the problem may never happen
again...