title: Javascript and React Native - Date object toLocaleString doesn't output properly on Android emulator
body: <p>I'm using <code>date_obj.toLocaleString()</code> and it's outputting <code>Sun Oct 17 09:57:59 2021</code>. I'd like to have it in the format <code>Oct 17 2021 09:57pm</code> so that's <code>MMM DD YYYY HH:MM AM/PM</code>. It should also be in local time to the current device. This is running on Android emulator. How can I do this?</p>
  <p>I tried this at it was an answer given</p>
  <pre><code>created.toLocaleString(&quot;en-US&quot;, {
                      year: &quot;numeric&quot;,
                      month: &quot;long&quot;,
                      day: &quot;numeric&quot;,
                      hour: &quot;numeric&quot;,
                      minute: &quot;numeric&quot;,
                      hour12: true,
                    })
  </code></pre>
  <p>But it still hasn't changed the date. I'm also running this on React Native.</p>
  <p><a href="https://i.stack.imgur.com/3UelO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3UelO.png" alt="enter image description here" /></a></p>
  <p>I also tried</p>
  <pre><code>options = {
    dateStyle:&quot;medium&quot;,
    timeStyle:&quot;short&quot;
  };
  </code></pre>
  <p>still same issue unfortunately</p>
  <p><a href="https://i.stack.imgur.com/bU0d1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bU0d1.png" alt="enter image description here" /></a></p>
  <p>here's the current state of the code</p>
  <pre><code>            &lt;Text style={{ fontSize: 13, color: &quot;grey&quot; }}&gt;
                {created.toLocaleString(&quot;en-US&quot;, {
                  year: &quot;numeric&quot;,
                  day: &quot;2-digit&quot;,
                  month: &quot;short&quot;,
                  hour: &quot;2-digit&quot;,
                  minute: &quot;2-digit&quot;,
                  hour12: true,
                })}
              &lt;/Text&gt;
  </code></pre>
  <p>Still no change</p>