Complicated Date to Lat Reverse function

M

mick white

Jasen said:
That doesn't mean it'll apply this years rules to last years dates.

(this done in mozilla/linux with
TZ=/usr/share/zoneinfo/right/Australia/Brisbane )

var x,y,d;
for(x=1990;x<=1995;++x)
{
d=new Date(x,0,1);
document.write(x+"->"+d.getUTCHours()+"<br>");
d.miliseconds+=24*3600000*365;
}


** milliseconds **

Mick
[]
 
R

Randy Webb

Dr John Stockton said the following on 1/15/2006 11:27 AM:
JRS: In article <[email protected]>
, dated Sat, 14 Jan 2006 09:30:17 local, seen in



I don't write to Microsoft specifications. I try to write to ECMA-262.

And that is a failure on your part.
If 1234/05/06 is not correctly recognised, then that's a bug.

MS wrote the browser.
MS wrote documentation on the browser.
MS' documentation says it will handle that date in a certain way.
The MS Browser handles that date in the way the documentation says it will.

Thats not a bug. Its a flaw in your perception of a bug.
It may be an implementation bug, a design bug, or a specification bug.

Or, it could be none of the above.


It's still, if intentional, stupidity, and, otherwise, it is incompetence.

In your biased opinion maybe, otherwise it's not.

This is a newsgroup; you should quote what you mean.

Nonsense. Giving a URL to a reference is just as well and in this case
it's better than copy/paste'ing that entire thread.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Sun, 15
Jan 2006 06:36:15 local, seen in Jasen Betts
That doesn't mean it'll apply this years rules to last years dates.

It means that it should do so.

ECMA-262, 3rd Edn, page 120, para 1 (in the *first* 15.9.1.9) seems
clear enough, also 15.9.1.8.
(this done in mozilla/linux with
TZ=/usr/share/zoneinfo/right/Australia/Brisbane )

I don't suppose the data set has an entry for Spring 1915; though
ideally it would have one.

var x,y,d;
for(x=1990;x<=1995;++x)
{
d=new Date(x,0,1);
document.write(x+"->"+d.getUTCHours()+"<br>");
d.miliseconds+=24*3600000*365;
}

1990->13
1991->13
1992->13
1993->14
1994->14
1995->14

Konqueor is even more "broken" it's calculating leap seconds! too.

I assume that the Brisbane area either changed Time Zone or (improbably)
Summer Time rules in 1992.

Don't know what the miliseconds line might have been intended for.

24*3600000 can be written 864e5; once seen, easily remembered, and no
risk of miscounting zeroes.
I wonder what the mozilla people had to do to sidestep that feature.

I imagine Mozilla calls an OS routine to do the conversion, rather than
compliantly reading the current rules and doing it itself; Konqueror
similarly.

I'd be pleased if you'd look at the new "Unapproved Chronology" section,
just above <URL:http://www.merlyn.demon.co.uk/js-dates.htm#SDR>, with
Brisbane/Linux .. and are there any Queensland residents here?

How do Leap Seconds show? Can it be that new Date(2006, 0, 1)%60000
is not zero, and by more than new Date(2006, 0, 0)%60000 ? Does
X59 show the effect, and, if not, what does?
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Tue, 17 Jan
2006 11:10:40 remote, seen in Jasen Betts
this in mozilla and konqueror

. 1991-01-01.0 -> 13
. 1992-01-01.0 -> 13
. 1993-01-01.0 -> 14
. 1994-01-01.0 -> 14

Good. The non-ECMA effect shows there.

this in konqueror:

. Local Date UTC ms % 60000
. 1997-01-01.0 -> 20000
. 1998-01-01.0 -> 21000
. 1999-01-01.0 -> 21000
. 2000-01-01.0 -> 22000
.
. There was a Leap Second at the end of 1998.

Early in 1999, for NZ ! I'd forgotten to allow for that. There was
also one in mid-1997, also shown by your results. I guess Americans
with such systems will see 20 21 22 22, since local clocks are behind
UTC there.

You are seeing there (1000*) the number of Leap Seconds since 1970 (the
first seems to have been mid-1972), which is *not* TAI-UTC. I've
changed the code to show seconds rather than milliseconds.
hmm...

I find the document somwhat confusing.. sample and actual output aren't
Clearly labeled, and why is the javascript doubled up?

One is 12:30 AM, one 12:30 PM.
NS4.08 PM bug:
Want 2002-04-21 1230h local : "Sun, 21 Apr 2002 22:29:38 +1000"
NS4.08 AM bug?:
Want 2002-04-21 0030h local : "Sun, 21 Apr 2002 22:29:38 +1000"

hmm, when it's 1030 in brisbane it's 12:30 here... but why am I getting
that answer in konqueror.

The 22 seconds slow will be the number of Leap Seconds since 1970;
perhaps the Leap Seconds are included only in one of the string to/from
Date Object conversions. Then there seems to be a ten-hour discrepancy
in the time, and 12:30 AM is wrongly taken as lunchtime.

It is likely that a number of routines on my pages will FAIL on browsers
that show Leap Seconds.
konqueror must be using the /etc/localtime setting too....
with timezone left to the default I get the NS PM bug in konqueror.

I was never sure quite what the NS bug did, though I was persuaded that
X05 would probably show it.


X05 -> X05A & X05B now. X05A is unchanged; X05B shows an intermediate
stage.



Aside : A .toLocaleString with format discontinuities at
1601 & 9999 is in Jscript.NET.

Some words relating JScript.NET, JScript, javascript,
and the WWW night be useful, somewhere?



<URL:http://www.merlyn.demon.co.uk/js-misc1.htm#OP> shows Object
Properties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top