Independent Date and Time objects/ISO Dates
Lars T Hansen
lth at acm.org
Wed May 16 01:37:56 PDT 2007
On 5/15/07, mkaply <mozilla at kaply.com> wrote:
> Lars T Hansen-2 wrote:
> > Some minor discussion last year but nothing serious. The Date object
> > represents a time stamp in milliseconds relative to a known time, so
> > really represents both date and time. Why is this not adequate?
> An ISO date does not need to contain a time. So how would an ISO only date
> be parsed into a Date object and then output as the same date only item?
> Right now if you give JS a date, it assumes a time. You need to be able to
> pass in a date with no time, have it stored as a date only with no time and
> then retrieve it as a date. ToLocaleString for instance on a date only
> should produce just a date with no time.
Ah. No, we've not talked about doing that, and you don't get to set a
bit on the Date object that says "the time does not matter". I
suppose you could, but I don't (yet) know what the consequences are.
For backwards compatibility a date string probably needs to yield a
Date object with a time. For ISO strings we could conceivably do
something different, but I'm not sure about that.
> View this message in context: http://www.nabble.com/Independent-Date-and-Time-objects-ISO-Dates-tf3760992.html#a10631582
> Sent from the Mozilla - ECMAScript 4 discussion mailing list archive at Nabble.com.
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
More information about the Es4-discuss