I apologise in advance if this sounds a bit long winded...

I've been trying to get a javascript time to convert correctly in C.

What I want to do is let the user set a date using a javascript form in a day/month/year format.

Then using that date I convert it into milliseconds using the javascript getTime() function.

I convert that time from milliseconds to seconds by dividing by 1000.

That value is sent to a cgi written in C, converted from a string to a long and then using ctime(longvalue) the dates should be same.
(I actually need the seconds value, not the actual date string)

The problem is that the dates don't match.
I've subtracted the timezone offset but it just doesn't work

I'm obviously doing something wrong
Here's a simplified version of the javascript function that I'm using.

function convert(day,month,year)
{
month-=1;
var conv=new Date(year,month,day,0,0,0);
ctime=(conv.getTime()/1000);
ctime-=(conv.getTimezoneOffset()*60);

document.timesform.CTIME.value=ctime;
// this value is set before the form is submitted to the cgi
}

Any pointers would be greatly appreciated.

Thanks
Brad