/**
* Date into time stamp
* Date format 2011-02-02 21:12:13
* TIME_STR: Date period 2011-02-02
* Fix_time: Time period 21:12:13
*/
function Strtotime (TIME_STR, Fix_time) {
var time = (new Date ()). GetTime ();
if (TIME_STR) {//have date segment
var str = time_str.split ('-');
if (3 = = Str.length) {
var year = parseint (str[0])-0;
var month = parseint (str[1])-0-1;//month is starting from 0
var day = parseint (str[2])-0;
if (fix_time) {//have time period
var fix = Fix_time.split (': ');
if (3 = = Fix.length) {
var hour = parseint (fix[0])-0;
var minute = parseint (fix[1])-0;
var second = parseint (fix[2])-0;
Time = (new Date (year, month, day, hour, minute, second)). GetTime ();
}
} else {
Time = (new Date (year, month, day)). GetTime ();
}
}
}
GetTime () Gets the time stamp to the number of milliseconds
Time = time/1000;//go to number of seconds
return time;
}