<script> var s="2010-5-18 12:30:20"; var t=new Date(s.replace(/-/g,"/")); alert(t.getTime()); </script>