Question: I am trying to parse a date string to javascript timestamp, the format of the string is `2013-01-01 12:00 AM` but when I attempt to alert the output all I can get is `NaN` My attempt is:

```
var ts_begin = Date.parse($('#fromdate').val()+' '+$('#fromtime').val());
alert(ts_begin);

```

Answer: 
`Date.parse` can only use specific formats. It's not a fan of the lack of space before AM/PM. Try:

```
Date.parse($("#fromdate").val() + ' ' + $("#fromtime").val()
   .replace(/[AP]M/, ' $&'));

```
```
var utc_timestamp = Date.UTC(now.getFullYear(),now.getMonth(), now.getDate(), 
    now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
alert(utc_timestamp);

```