title: How do I Convert DateTime from UTC to Local and then Capture elements reliably
body: <p>I'm storing the Date/Time in SQL in UTC time zone regardless of the time zone the user is in.</p>
  
  <p>Now I need to display the D/T in local time zone on the client machine - in separate fields (dropdowns for month, day, hour, etc), thus after converting the D/T to local, I need to break it apart, but using <em>.toLocal</em> and <em>.toLocalString</em> are not consistent across browsers and user preferences; I therefore can not break the string apart consistantly. </p>
  
  <p>Here's what I'm doing:</p>
  
  <pre><code>var utcDTString=$("#utcDateTime"); // this is in format YYYY-MM-DD HH:MM:SS coming from SQL in UTC Time zone
  var utcDateObj=new Date(utcDTString+' UTC'); // create a date obj of UTC DateTime in UTC time zone
  var localDT=utcDateObj.toLocaleString(); // convert the DT to local Time zone 
  </code></pre>
  
  <p>Now, how do I reliably extrapolate the Year, Month, Day, Hour, Minute from <em>localDT</em> given that different browsers and user preferences could cause the string to be in various formats.</p>
  
  <p>I looked to see if I could specify a layout for <em>.toLocaleString</em> but couldn't find anything.</p>