title: Step through JSON Object, Use Regex to create Javascript Date Objects from Unix Timestamp for Google Chart
body: <p>I've generated the following JSON Object in php and am passing it through AJAX to my javascript. This JSON object as is will not suffice since the Google Charts API I am using needs a javascript date object for each date in the JSON. </p>
  
  <p>My dates are currently encoded in UNIX timestamp -- 1199170800,1201849200,1343800800,1346479200. I figure I could add a regex quantifier on one side of the timestamp (ie: ~1346479200), use REGEX to find the date based on the quantifier, convert the date to javascript object, and then replace each quantifier with the regex. Easier said then done for some. </p>
  
  <pre><code>{"cols":[{"type":"date","label":"FromDate"},{"type":"number","label":"Electricity Use     
  (KWH)"},{"type":"number","label":"Cooling Degree Days"}],"rows":[{"c":       
  [{"v":1199170800,"f":"Jan-08"},{"v":"559280","f":"559,280"},{"v":"0"}]},{"c":
  [{"v":1201849200,"f":"Feb-08"},{"v":"653193","f":"653,193"},{"v":"381"}]},{"c":
  [{"v":1343800800,"f":"Aug-12"},{"v":"667874","f":"667,874"},{"v":"322"}]},{"c":
  [{"v":1346479200,"f":"Sep-12"},{"v":"687299","f":"687,299"},{"v":"101"}]}]} 
  </code></pre>
  
  <p>I've looked through many similar posts to get some ideas, but I can't solve this one... Similar, seemingly useful posts: </p>
  
  <p><a href="https://stackoverflow.com/questions/10758112/loop-through-object-get-value-using-regex-key-matches-javascript">Loop through object get value using regex key matches Javascript</a></p>
  
  <p><a href="http://sudarshanbhalerao.wordpress.com/2011/08/14/convert-json-date-into-javascript-date/" rel="nofollow noreferrer">http://sudarshanbhalerao.wordpress.com/2011/08/14/convert-json-date-into-javascript-date/</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9180519/date-range-google-chart-tools">Date Range Google Chart Tools</a></p>