Can anyone explain why my date function is giving me a wrong conversion via JS date object?
<p>Sorry for the title if it doesn't explain my problem too well.</p>

<p>I'm having a weird problem in my script where in the initial stage, I convert a date string into milliseconds and then later on in the script, it is converted back to a legible date format. The date strings that give me problems are the ones that have the regular date, but also have the hour attached to it as well. Here's an example:</p>

<pre><code>legitDate = function (date) {

    var months = ['01', '02', '03', '04', '05', '06',
                  '07', '08', '09', '10', '11', '12'];

    return months[date.getUTCMonth()] + "/" + date.getUTCDate() + "/" + date.getUTCFullYear()
}

var init = Date.parse("1/27/2016  7:00:00 PM");
var ayy = new Date(init);
var result = legitDate(ayy);
</code></pre>

<p>The finial result reads 1/28/2016, instead of the original 1/27/2016. I have no idea why this conversion is happening the way it's happening.</p>