To convert a date into a timestamp we need to use the UTC() function of the Date object. This function takes 3 required parameters and 4 optional parameters. The 3 required parameters are the year, month and day, in that order. The optional 4 parameters are the hours, minutes, seconds and milliseconds of the time, in that order.
To create the time do something like this:
var datum = new Date(Date.UTC('2009','01','13','23','31','30'));
This prints out 1234567890. Here is a function to simplify things:
var datum = new Date(Date.UTC(year,month-1,day,hour,minute,second));
Notice that when adding in the month you need to minus the value by 1. This is because the function requires a month value between 0 and 11. However, there is an easier way of getting the timestamp by using the parse() function. This function returns the timestamp in milliseconds, so we need to divide it by 1000 in order to get the timestamp.
var datum = Date.parse(strDate);
This can be run by using the following, not that the date must be month/day when writing the date like this.