Dodgy website american date problem
Discussion
Hello peeps,
My shiny new website has an interesting error. It's essentially a training courses website written using standard Dreamweaver tools and an SQL database to hold the information. When we submit a course to the website, using the date format dd/mm/yyyy the date gets transposed to american format if the day is less than 12. We've tried absolutely everything to iron this out but have drawn a blank. The coding on the site and the host is the same as other sites where this isn't occurring. It is only on submitting the course entry form it occurs - you can go into the back-end database and correct the date without the error happening again. Does anyone have any ideas where to look for the error?
My shiny new website has an interesting error. It's essentially a training courses website written using standard Dreamweaver tools and an SQL database to hold the information. When we submit a course to the website, using the date format dd/mm/yyyy the date gets transposed to american format if the day is less than 12. We've tried absolutely everything to iron this out but have drawn a blank. The coding on the site and the host is the same as other sites where this isn't occurring. It is only on submitting the course entry form it occurs - you can go into the back-end database and correct the date without the error happening again. Does anyone have any ideas where to look for the error?
zaktoo said:
Url? How does the script that handles the form process the date, as a string or break it into component parts (Day, month year)?
Ciao
Zak
www.esis.org.uk but needs a secure log in to see course submission form. We split out the days into individual elements, we even put in a calendar script eventually but it still transposes the day and month if it detects an incorrect date if thinking american format. Ciao
Zak
I'd wager that the default locale when the SQL Server was set up was US.
We've had this problem in the past where SQL default locale was US but all the services ran under accounts with UK settings. Still caused us problems inserting dates. No problem reading them - just inserting them.
good luck as it can be a bastid to sort out.
We've had this problem in the past where SQL default locale was US but all the services ran under accounts with UK settings. Still caused us problems inserting dates. No problem reading them - just inserting them.
good luck as it can be a bastid to sort out.
XJ_Wanty said:
I don't think it's that - we can go into the database away from the website and correct the dates where they then stay correct. As you say, this is a bugger to sort out!
ah but what locale has the account you use to directly access the database got? is it the same as the accounts that the web site applications run under?
zaktoo said:
Can you post the source of the submission form? Or even just the date fields as entered? That may give us some clue. The real problem I would bet lies on the processing of that form on the server side.
Ciao
Zak
OK, go to www.esis.org.uk sign in as PHtest username and password, then click on Administration on the left and go from there. Ciao
Zak
Thanks, BTW.
Did you add or change any of this? Looks like you should be using the first set of statements TBH, (or possibly the last). If you've already tried all this, then your server-side processing needs to be addressed.
function processform ()
{
var f = document.InsertForm;
// f.StartDate.value = f.selDay440325.value + '/' + f.selMonth440325.value + '/' + f.selYear440325.value;
// f.EndDate.value = f.selDay158676.value + '/' + f.selMonth158676.value + '/' + f.selYear158676.value;
f.StartDate.value = f.selMonth440325.value + '/' + f.selDay440325.value + '/' + f.selYear440325.value;
f.EndDate.value = f.selMonth158676.value + '/' + f.selDay158676.value + '/' + f.selYear158676.value;
// f.StartDate.value = f.selYear440325.value + '-' + f.selMonth440325.value + '-' + f.selDay440325.value;
// f.EndDate.value = f.selYear158676.value + '-' + f.selMonth158676.value + '-' + f.selDay158676.value;
// f.StartDate.value = f.selYear440325.value + f.selMonth440325.value + f.selDay440325.value;
// f.EndDate.value = f.selYear158676.value + f.selMonth158676.value + f.selDay158676.value;
return true;
}
Let me know if changing this bit of javascript sorts you.
Ciao
Zak
function processform ()
{
var f = document.InsertForm;
// f.StartDate.value = f.selDay440325.value + '/' + f.selMonth440325.value + '/' + f.selYear440325.value;
// f.EndDate.value = f.selDay158676.value + '/' + f.selMonth158676.value + '/' + f.selYear158676.value;
f.StartDate.value = f.selMonth440325.value + '/' + f.selDay440325.value + '/' + f.selYear440325.value;
f.EndDate.value = f.selMonth158676.value + '/' + f.selDay158676.value + '/' + f.selYear158676.value;
// f.StartDate.value = f.selYear440325.value + '-' + f.selMonth440325.value + '-' + f.selDay440325.value;
// f.EndDate.value = f.selYear158676.value + '-' + f.selMonth158676.value + '-' + f.selDay158676.value;
// f.StartDate.value = f.selYear440325.value + f.selMonth440325.value + f.selDay440325.value;
// f.EndDate.value = f.selYear158676.value + f.selMonth158676.value + f.selDay158676.value;
return true;
}
Let me know if changing this bit of javascript sorts you.
Ciao
Zak
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


