Datepicker and tstamp problem

Datepicker and tstamp problem

Hi everyone,
I have some problem with tstamp function. I have two input field with datepicker (#date_from and #date_to) and select fields with hour and minutes (#time_from_hour, #time_from_minute, #time_to_hour, #time_to_minute). My date format looks like this: 1/11/2012

I use this script to calculating tstamp from above fields:
  1. function compute() {
  2.         var c = $('select#time_from_hour').val();
  3.         var d = $('select#time_from_minute').val();
  4.         var e = $('select#time_to_hour').val();
  5.         var f = $('select#time_to_minute').val();
  6.         var g = $('input#date_from').val();
  7.         var h = $('input#date_to').val();
  8.         date1= g.split("/");
  9.         var timestamp = (new Date(date1[2],date1[1],date1[0],c,d).getTime()/1000) + 7200;
  10.         $('#total_hour1').val(timestamp);
  11.         date2= h.split("/");
  12.         var timestamp = (new Date(date2[2],date2[1],date2[0],e,f).getTime()/1000) + 7200;
  13.         $('#total_hour2').val(timestamp);
  14.         var x = -$('input#total_hour1').val();
  15.         var y = -$('input#total_hour2').val();
  16.         var total_time = x - y;
  17.         result = total_time / 86400;
  18.         new_number = Math.ceil(result);
  19.         if(isNaN(new_number)) {
  20.           var new_number = 0;
  21.         }
  22.         $('#finish_day').val(new_number);
  23. }
That script should calculating finish day ( the difference between two dates). And here is a problem:

When I pick the 31/10/2012 the tstamp is: 1354335300 (Sat, 01 Dec 2012 04:15:00 GMT)
and when I pick up on the second field 1/11/2012 the tstamp is also 1354335300 (Sat, 01 Dec 2012 04:15:00 GMT).

The day and the month are wrong and the #finish_day = 0, and I don't know why?
Where is the problem?

I will be grateful for any help.

The working code you can find here: http://jsfiddle.net/W7NHK/