<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>UK Ruby on Rails, Exalead, AWS, Consultancy - Making a date with JavaScript and JSON Comments</title>
  <id>tag:thewebfellas.com,2011:/blog/2008/9/13/making-a-date-with-javascript-and-json/comments</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://thewebfellas.com/blog/2008/9/13/making-a-date-with-javascript-and-json/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/blog/2008/9/13/making-a-date-with-javascript-and-json" rel="alternate" type="text/html"/>
  <updated>2010-11-11T20:52:01Z</updated>
  <entry xml:base="http://thewebfellas.com/">
    <author>
      <name>Jase</name>
    </author>
    <id>tag:thewebfellas.com,2008-09-13:1802:20664</id>
    <published>2010-11-11T16:42:08Z</published>
    <updated>2010-11-11T16:42:08Z</updated>
    <category term="Blog"/>
    <link href="http://thewebfellas.com/blog/2008/9/13/making-a-date-with-javascript-and-json" rel="alternate" type="text/html"/>
    <title>Comment on 'Making a date with JavaScript and JSON' by Jase</title>
<content type="html">&lt;p&gt;date.js is clearly slick for lots of purposes, but it's overkill if you just need to convert a date from Rails JSON output to a JS Date object.&lt;/p&gt;

&lt;p&gt;For a date in the format '2010-11-05T19:53:22-04:00':&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;date_string = '2010-11-05T19:53:22-04:00';
x = date_string.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/));
var d = new Date(x[1],x[2],x[3],x[4],x[5],x[6]);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(Yes, I'm ignoring timezone -- all my dates are local time.)&lt;/p&gt;

&lt;p&gt;date.js would handle this nicely, but it's an extra 25kb for your users to download.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://thewebfellas.com/">
    <author>
      <name>Joe Ellis</name>
    </author>
    <id>tag:thewebfellas.com,2008-09-13:1802:3146</id>
    <published>2009-02-26T01:24:10Z</published>
    <updated>2009-02-26T01:24:10Z</updated>
    <category term="Blog"/>
    <link href="http://thewebfellas.com/blog/2008/9/13/making-a-date-with-javascript-and-json" rel="alternate" type="text/html"/>
    <title>Comment on 'Making a date with JavaScript and JSON' by Joe Ellis</title>
<content type="html">&lt;p&gt;I was just searching for something to easily parse JSON as well as a strftime function.  This helped out a lot, thanks!  They really should update their site a little though, I imagine most people visiting would lose interest after noticing the Alpha-1 part.&lt;/p&gt;</content>  </entry>
</feed>

