Prev: Computer Techs Wanted
Next: move div by drag etc.
From: Hans-Georg Michna on 8 Oct 2009 03:54 On Wed, 7 Oct 2009 20:33:56 +0100, Dr J R Stockton wrote: >You could have read <URL:http://www.merlyn.demon.co.uk/js=-date0.htm#DC> >instead of asking. Could you check the link? I get Page not found (404). Perhaps a little typo. However, even if that page explains very well how Date behaves, it is still not an official specification, or is it? I mean, who guarantees that Date will still behave that way in the next new browser or browser version? Hans-Georg
From: Richard Cornford on 8 Oct 2009 04:59 Hans-Georg Michna wrote: > On Tue, 6 Oct 2009 20:12:45 +0100, Dr J R Stockton wrote: > >> The term is good enough for ISO/IEC 16262 15.9, which (for >> example) includes "A Date object contains a number indicating >> a particular instant in time to within a millisecond. The >> number may also be NaN, indicating that the Date object does >> not represent a specific instant of time.". > > While you're at it, I've seen scripts that compare two Date > objects directly, but I could not find any clue in any > specification that this should work. > > The quoted text above also mentions the contained milliseconds, > but it does not say that the Date object behaves like a number. > It does not say how you get at those milliseconds. Elsewhere it > is specified that you can use .getTime() to get at them. The Date object's - valueOf - method returns its 'time value', which is the millisecond value. Any process specified as calling the - valueOf - methods of objects will see this numeric value, including, for example, step 1 in "The Abstract Relational Comparison Algorithm" (11.8.5), where it reads "Call ToPrimitive(x, hint Number)". All other type-converting-to-number processes applied to a date object will call its - valueOf - method and use the result. Richard.
From: Dr J R Stockton on 8 Oct 2009 10:21 In comp.lang.javascript message <jNkCdHLxTOzKFwP$@J.A830F0FF37FB96852AD0 8924D9443D28E23ED5CD>, Wed, 7 Oct 2009 19:58:57, John G Harris <john(a)nospam.demon.co.uk> posted: >In the standard, "Date object" means the function object in section 4.2 >and an object constructed by Date in section 15.9. The term is >thoroughly ambiguous and should be avoided where clarity is desired. You'll tell that to TC39, I trust? -- (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk BP7, Delphi 3 & 2006. <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links; <URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ; NOT <URL:http://support.codegear.com/newsgroups/>: news:borland.* Guidelines
From: Dr J R Stockton on 8 Oct 2009 10:25 In comp.lang.javascript message <haj2vd$j23$1(a)news.eternal- september.org>, Wed, 7 Oct 2009 14:59:03, Garrett Smith <dhtmlkitchen(a)gmail.com> posted: >John G Harris wrote: >> On Mon, 5 Oct 2009 at 19:43:47, in comp.lang.javascript, Dr J R Stockton >> wrote: >>> In comp.lang.javascript message <4ac928fb$0$289$14726298(a)news.sunsite.dk >>>> , Sun, 4 Oct 2009 23:00:03, FAQ server <javascript(a)dotinternet.be> >>> posted: >>> >>>> FAQ Topic - How can I create a Date from a String? >>> That makes no sense; should be "Date Object". >> <snip> >> Strictly speaking, the Date Object is the object named Date : the >> constructor you use when you do new Date(). >> > >And one of those is "a Date". > >A Date *is* and Object. Adding "Object" is redundant. YGCIB. It is not superfluous, since "date" is an ordinary English word and may also be used with that meaning - and in a natural language a little redundancy is often a great help in transferring a meaning without either error or doubt. -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
From: Dr J R Stockton on 8 Oct 2009 10:54
In comp.lang.javascript message <b097d82a-9ff2-48a9-9472-83ea7c86b793(a)r3 6g2000vbn.googlegroups.com>, Wed, 7 Oct 2009 12:48:08, Asen Bozhilov <asen.bozhilov(a)gmail.com> posted: >"FAQ server" wrote: > >> function parseISO8601(dateStringInRange) > >parseISO8601 and Date object in ECMA 3 works with dates from Gregorian >calendar. And they follows algorithm for leap year in Gregorian >calendar, where: > >year % 4 == 0 && (year % 100 != 0 || year % 400 == 0) > >In Julian calendar leap year is every year who's: > >year % 4 == 0 > >Gregorian calendar since from 24 February 1582. ><URL:http://en.wikipedia.org/wiki/Gregorian_calendar> > >Because that, date likes this: > >new Date(1300, 1, 29); // Mon Mar 01 1300 00:00:00 GMT+0200 (FLE >Standard Time) >new Date(1400, 1, 29); // Sat Mar 01 1400 00:00:00 GMT+0200 (FLE >Standard Time) >new Date(1500, 1, 29); // Thu Mar 01 1500 00:00:00 GMT+0200 (FLE >Standard Time) > >For my that's dates is absolutely valid date. That's dates existed in >real life. ECMA 262 Edn 3 and ISO/IEC 16262 specify that the calendar to be used for all dates is the extrapolated Gregorian calendar (with the Summer Time rules of the machine's locality and the present time[*]). ECMA 262 Final Draft 5 agreed. For Julian Calendar date routines in JavaScript, see in <URL:http://www.merlyn.demon.co.uk/js-date8.htm>. Accommodating all changes of Summer Time rules and Calendar rules would be difficult, error-prone, and not worth while. Note, for example, that in Great Britain and elsewhere the UTC instants represented by those "new Date" calls would actually have been in 1299 1399 1499, since the legal supputation of the year changed the number at March 25th. Then consider Alaska, which in October 1867 had two consecutive Fridays, October 6th and 18th? And should the date of the Papal Bull /Inter gravissimas/ be given as (in Italian) 24th February 1581 (Julian, O.S.) or as 6th March 1582 proleptic Gregorian or as in "Datum Tusculi Anno Incarnationis Dominicae M. D. LXXXI. Sexto Calend. Martij, Pontificatus nostri Anno Decimo.", which is what His Holiness apparently signed? [*] Which means that all law-abiding America-resident JavaScript users should have updated their systems (or have had Vista, etc., do it for them) at exactly 12:00 a.m. on 03/01/2007, since that is by US Law when their new rules actually became current. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc. |