title: javascript behaves differently in different browsers
body: <p>I am working on a project which need to deal with a lot of "dates". I notice that sometimes javascript behaves differently in different browsers:</p>
  
  <p>code:</p>
  
  <pre><code>new Date("Mar 30, 2017".replace(',', '').replace(/ /g, '/'))
  </code></pre>
  
  <p>I know I don't need to use <code>replace</code> to create date, but this code gives me interesting different result from Chrome and Safari.</p>
  
  <p>While I run:</p>
  
  <pre><code>"Mar 30, 2017".replace(',', '').replace(/ /g, '/')
  </code></pre>
  
  <p>Both Chrome and Safari will gives me: <code>"Mar/30/2017"</code>. But when I try to turn the result into a <code>Date</code> object, the interesting result will be:</p>
  
  <pre><code>Chrome: Thu Mar 30 2017 00:00:00 GMT-0700 (PDT)
  Firefox: Date 2017-03-30T07:00:00.000Z
  Safari: Invalid Date
  </code></pre>
  
  <p>I have already checked Javascript version of both browsers, and they are using the same version (1.7). Can anyone explain why Chrome behaves differently than Safari in this regard?</p>
  
  <p><strong>UPDATE</strong>
  I know <code>"Mar/30/2017"</code> is not a valid Date format. But my question is <strong>why javascript behaves differently in different browsers</strong>. For those answers complaining about my Date format. Please read the question before answer it. I will take @Felix Kling 's answer, and thanks for all answers all the same. </p>