javascript date set unix timestamp code example
Example 1: javasctipt unix timestamp from date
Math.round(new Date().getTime() / 1000).toString()
Example 2: convert date to unix timestamp javascript
new Date('2012.08.10').getTime() / 1000 //secs
new Date('2012.08.10').getTime() //milliseconds