Converting UTC string to epoch time in javascript
How can I convert UTC date-time string (e.g. 2011-03-29 17:06:21 UTC ) into Epoch (milliseconds) in javascript? If this is not possible, is there any way to compare (like <, >) UTC date time strings? Note that UTC date strings can be compared lexicographically, like strings, since the higher order values appear leftmost in the string. var s1 = '2011-03-29 17:06:21 UTC' , s2 = '2001-09-09 01:46:40 UTC'; s1 > s2; // => true s2 > s1; // => false You can extract the date fields from your example string and return the number of milliseconds by using the Date.UTC method: var getEpochMillis =