We would like to know how to convert date as '26-02-2012' to timestamp.
<!DOCTYPE html>
<html>
<body>
<script type='text/javascript'>
<!-- w ww. ja v a2s . c o m-->
var myDate="26-02-2012";
myDate=myDate.split("-");
var newDate=myDate[1]+"/"+myDate[0]+"/"+myDate[2];
document.writeln(new Date(newDate).getTime());
</script>
</body>
</html>
The code above is rendered as follows: