 <p>You can just use moment.js, and this is all in <a href="http://momentjs.com/docs" rel="nofollow">the documentation</a>.</p> <pre><code>moment('6/29/2014 8:30am','M/D/YYYY h:mma').toISOString() </code></pre> <p>This assumes all of the following:</p> <ul> <li><p>The source value is in the user's time zone (that is - the time zone of the machine where the JavaScript code is running)</p></li> <li><p>The input will always be in the specified format</p></li> </ul> <p>It's also worth mentioning that if you put a space before the "am", that most modern browsers can do this natively without any library:</p> <pre><code>new Date('6/29/2014 8:30 am').toISOString() </code></pre> <p>If you take that approach, realize that the date parts are ordered according to the users locale, which might be m/d/y, or d/m/y or y/m/d.</p> <p>Also, you said in the title "... with no milliseconds", but didn't elaborate on that in your question. I'm fairly certain you can pass the milliseconds without issue. There's no good reason to go out of your way to remove them. But if you must, then that would be like this with moment:</p> <pre><code>moment('6/29/2014 8:30am','M/D/YYYY h:mma').utc().format('YYYY-MM-DD[T]HH:mm:ss[Z]') </code></pre>