Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

US date default on web server

Status
Not open for further replies.

Speckly

Technical User
Jun 9, 2004
18
0
0
GB
Hi Everyone,

Here's my problem.

I have a coldfusion form which requires the users to selected from list boxes start and end dates. These dates are then used in a query on the database. All works well on my computer,(i.e. all the right files are downloaded) but when I put my site on the web server strange things happen...

On the server.. if the day of the month is between 1 and 12 the server assumes that the date is a us date mm/dd/yy. If the day is above 12 then the web server gets it right i.e. a uk date is assumed!

Thus, it seems that the server defaults to US date unless it obviously can't be then it assumes UK format as a secondary choice.

What can I do?? I feel stuck because the code on my local host computer is working perfectly by correctly using UK date format all the time and the server is messing things up!!

Any help would be much appreciated!
 
Show us some code, how are you formatting the dates for your queries?



Hope This Helps!

Ecobb

"My work is a game, a very serious game." - M.C. Escher
 
Okay, here goes....

On the cfform page the two date variables are sent
as a string like "01/04/2003".

On the action page this is how I format the dates. I've tried to show the bits of the code thats relevant.


Code:
<cfset setLocale("English (UK)")> <!--- set the coldfusion server to UK setting explicitly--->

<cfset CreateODBCDate(form.startdate)>
<cfset CreateODBCDate(form.enddate)>


<cfquery name="export_selected_gn_records" datasource="supporting_people">

SELECT *
FROM GENERAL_NEEDS_CLEAN
WHERE ManagingAssoc = #CLIENT.id# and LetDate BETWEEN #LSParseDateTime(form.StartDate)#
AND #LSParseDateTime(form.EndDate)#
ORDER BY LetDate ASC 
</cfquery>


Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top