Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="https://github.com/datejs/Datejs" rel="noreferrer">datejs</a> could parse following, you might want to try out.</p> <pre><code>Date.parse('1997-07-16T19:20:15') // ISO 8601 Formats Date.parse('1997-07-16T19:20:30+01:00') // ISO 8601 with Timezone offset </code></pre> <p><strong>Edit:</strong> Regex version</p> <pre><code>x = "2011-01-28T19:30:00EST" MM = ["January", "February","March","April","May","June","July","August","September","October","November", "December"] xx = x.replace( /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):\d{2}(\w{3})/, function($0,$1,$2,$3,$4,$5,$6){ return MM[$2-1]+" "+$3+", "+$1+" - "+$4%12+":"+$5+(+$4&gt;12?"PM":"AM")+" "+$6 } ) </code></pre> <p>Result</p> <pre><code>January 28, 2011 - 7:30PM EST </code></pre> <p><strong>Edit2:</strong> I changed my timezone to EST and now I got following</p> <pre><code>x = "2011-01-28T19:30:00-05:00" MM = {Jan:"January", Feb:"February", Mar:"March", Apr:"April", May:"May", Jun:"June", Jul:"July", Aug:"August", Sep:"September", Oct:"October", Nov:"November", Dec:"December"} xx = String(new Date(x)).replace( /\w{3} (\w{3}) (\d{2}) (\d{4}) (\d{2}):(\d{2}):[^(]+\(([A-Z]{3})\)/, function($0,$1,$2,$3,$4,$5,$6){ return MM[$1]+" "+$2+", "+$3+" - "+$4%12+":"+$5+(+$4&gt;12?"PM":"AM")+" "+$6 } ) </code></pre> <p>return</p> <pre><code>January 28, 2011 - 7:30PM EST </code></pre> <p>Basically</p> <pre><code>String(new Date(x)) </code></pre> <p>return </p> <pre><code>Fri Jan 28 2011 19:30:00 GMT-0500 (EST) </code></pre> <p>regex parts just converting above string to your required format.</p> <pre><code>January 28, 2011 - 7:30PM EST </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload