Javascript: Get a unixtime value

I need a Unixtime in Javascript. This is the simplest way I came up with to get that value:

var unixtime = parseInt(new Date().getTime() / 1000);

Update: Newer versions of Javascript (and browsers) now offer Date.now() which returns milliseconds since the epoch with less typing required.

var unixtime = parseInt(Date.now / 1000);


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 18.118.19.123
To prevent spam please submit by clicking the kitten: