Jquery Date Format with JavaScript
<p>I'm using jQuery and want to format a date. I don't want to have to import another plug-in for jQuery. I have found a solution that works in JavaScript i.e.</p>

<pre><code>var now = new Date(); 

var curr_date = d.getDate();

var curr_month = d.getMonth();

curr_month++;

var curr_year = d.getFullYear();

$('##optionButtons').append('&lt;a href="##"class="btn"&gt;' 
+ curr_date + "-" + curr_month + "-" 
+ curr_year + '&lt;/a&gt; &lt;/ br&gt;');
</code></pre>

<p>However, when I add the date shown in the example below I get the following error, why? </p>

<pre><code>var d = value.CREATED;

var curr_date = d.getDate();

var curr_month = d.getMonth();

curr_month++;

var curr_year = d.getFullYear();

$('##optionButtons').append('&lt;a href="##"&gt;' 
+ curr_date + "-" + curr_month + "-" 
+ curr_year + '&lt;/a&gt; &lt;/ br&gt;');   
</code></pre>

<p>ERROR ##################### 
 d.getDate is not a function
 ###########################</p>

<p>The value of 'value.CREATED' is October, 25 2012 00:00:00+0000</p>
