Date.prototype.getTimestamp = function ()
{
var date = this;
var timestamp = Math.round(date.getTime()/1000);
timestamp = timestamp - (date.getTimezoneOffset () * 60);
return timestamp;
}
usage is simple:
var new_Date = Date();
alert(date.getTimestamp());
No comments:
Post a Comment