Use the Date object's getTime()
method, which returns the number of milliseconds since 1 January 1970 00:00:00 UTC (epoch time):
var date = new Date();
var copiedDate = new Date(date.getTime());
In Safari 4, you can also write:
var date = new Date();
var copiedDate = new Date(date);
...but I'm not sure whether this works in other browsers. (It seems to work in IE8).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…