How to inherit from Javascript Date Object?
<p>I am trying to create and object that inherits from the Date object.</p>

<p>Below is a Firebug transcript of what I am trying to do.</p>

<pre><code>&gt;&gt;&gt; date_son = Object.create( Date )
Function {}
&gt;&gt;&gt; typeof date_son
"object"
&gt;&gt;&gt; date_son.gettime
undefined
&gt;&gt;&gt; date_son.prototype.getTime
getTime()
</code></pre>

<p>I use Object.create to create an object date_son which inherits from Date. The getTime function/attribute is available on  date_son.protype, but not on the date_son object itself.</p>

<p>I am clearly doing something wrong. Can anyone point me in the right direction on how to create an object that inherits from Date so that date_son.getTime() is available on the date_son object.</p>

<p>I do not wish to extend Date directly, because I think messing/changing globals is bad programming practice.</p>
