Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JScript date bug - again

26 views
Skip to first unread message

Dr J R Stockton

unread,
Jan 29, 2018, 6:24:57 PM1/29/18
to

// This tests JScript clock change dates; errors in Win 7 & 10
// Run in WSH at command line with Prompt>cscript //nologo jscptbug.js
// For a browser, remove use of WScript object and use alert(Out)

var IzzDat, IzzOff, WozDat, WozOff = NaN, J, Out = []

Out.push(" JSCPTBUG.JS\t(c) J R Stockton\t2018-01-29+")

Out.push(
"\n Your " + WScript.Name + " is version " + WScript.version +
"\n Your Script Engine is " + ScriptEngine() + " " +
ScriptEngineMajorVersion() + "." +
ScriptEngineMinorVersion() + "." + ScriptEngineBuildVersion() )

IzzDat = new Date()
Out.push(" They say :\n LCT = " + IzzDat.toString() +
"\n GMT = " + IzzDat.toUTCString())

Out.push(
" The following shows roughly when your civil clock offset\n" +
" changes over four years, according to your Script Engine.")

function Pad5(N) { var S = String(N)
while (S.length < 5) S = " " + S ; return S }

for (J = 0 ; J < 1475 ; J++) {
IzzDat = new Date(2017, 0, J) ; IzzOff = IzzDat.getTimezoneOffset()
if (J > 0 && IzzOff != WozOff) {
Out.push("")
Out.push(Pad5(WozOff) + " " + WozDat)
Out.push(Pad5(IzzOff) + " " + IzzDat)
}
WozOff = IzzOff ; WozDat = IzzDat
}

Out = Out.join("\n") + "\n -----"

// alert(Out)

WScript.StdOut.WriteLine(Out)

// End


Running in current Chrome, as indicated at the top, for 2018 I get

0 Sun Mar 25 2018 00:00:00 GMT+0000 (GMT Standard Time)
-60 Mon Mar 26 2018 00:00:00 GMT+0100 (GMT Daylight Time)

-60 Sun Oct 28 2018 00:00:00 GMT+0100 (GMT Daylight Time)
0 Mon Oct 29 2018 00:00:00 GMT+0000 (GMT Standard Time)

which are the correct dates for the EU.

Running in WSH in the UK, for 2018 I get

0 Sun Mar 11 00:00:00 UTC 2018
-60 Mon Mar 12 00:00:00 UTC+0100 2018

-60 Sun Nov 4 00:00:00 UTC+0100 2018
0 Mon Nov 5 00:00:00 UTC 2018

showing the US time change dates.

--
(c) John Stockton, near London, UK. Using Google Groups. |
Mail: J.R.""""""""@physics.org - or as Reply-To, if any. |

menti...@gmail.com

unread,
Jan 29, 2018, 11:28:53 PM1/29/18
to
On Monday, January 29, 2018 at 3:24:57 PM UTC-8, Dr J R Stockton wrote:
> // This tests JScript clock change dates; errors in Win 7 & 10
> // Run in WSH at command line with Prompt>cscript //nologo jscptbug.js
> // For a browser, remove use of WScript object and use alert(Out)
>
> var IzzDat, IzzOff, WozDat, WozOff = NaN, J, Out = []
>
> Out.push(" JSCPTBUG.JS\t(c) J R Stockton\t2018-01-29+")
>
[...]
> --
> (c) John Stockton, near London, UK. Using Google Groups. |
> Mail: J.R.""""""""@physics.org - or as Reply-To, if any. |

We can not tolerate any defects in the various JavaScript "Date" thingies!

The future of the civilized world is at stake here.

http://ai.neocities.org/MsIeAi.html -- has the following code:

function MindBoot() { // http://ai.neocities.org/MindBoot.html
dob = new Date(); // 2018-01-24: date-of-birth in competition for old AI.
HCI(); // 2018-01-18: Human-COmputer Interface

The above code in the Tutorial Artificial Intelligence

makes it possible for the following code

apb = "EnThink() at time = "+t+"; rejuvenations = "+rjc+"; since dob "+dob; // 2018-01-24:
Voice(); // 2018-01-20: speak the all-points-bulletin "apb";

to remind human users how long the AI Mind has been alive,
with the avowed goal of getting AI installations (schools, labs)
to compete for the coveted status of hosting the oldest living AI.

Furthermore, any high-school or college may appoint an

http://ai.neocities.org/maintainer.html -- "AI Mind Maintainer"

for the care and feeding of each artificial intelligence.
Why, those who capture and download the JavaScript AI from

http://ai.neocities.org/MsIeAi.html -- Microsoft Internet Explorer AI --

are welcome and at liberty to install the JSAI on their own sites
with their own links substituted in the Control Panel legend and
with their own informational ideas in the innate knowledge base (KB).
The JavaScript AI can be a way to monetize your expertise in JavaScript.
Once a JavaScript maven understands the concept-based AI Mind, (s)he
may go on to work with the MindForth AI for robots or ghost.pl in Perl.

Have at it!

ATM
--
http://cyborg.blogspot.com
http://www.reddit.com/r/mentifex
http://ai.neocities.org/theory.html
http://github.com/PriorArt/AGI/wiki/MindGrid
0 new messages