By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,899 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,899 IT Pros & Developers. It's quick & easy.

Advance Date +15 Days

P: n/a
I have a script...
-----
<SCRIPT language="JavaScript" type="text/javascript">
<!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}

function makeArray0() {
for (i = 0; i<makeArray0.arguments.length; i++)
this[i] = makeArray0.arguments[i];
}

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

var months = new
makeArray('January','February','March','April','Ma y','June','July','August','September','October','N ovember','December');
var days = new
makeArray0('Sunday','Monday','Tuesday','Wednesday' ,'Thursday','Friday','Saturday');

var today = new Date();
var day = days[today.getDay()];
var date = today.getDate( ) + 15;
var month = today.getMonth() + 1;
var year = y2k(today.getYear());

document.write(months[month] +' ' + date + ', ' + year);
//-->
</SCRIPT>
---

I need this script to advance the document.write by 15 days, as you can see
I tried adding "+ 15"
after the Var Date = today.getDate( ) that works fin until it started
showing 32 days in June
today. LOL.

Can anyone please assist me? Ro****@BeatToBeat.com

Thank you,
Robert
Jul 23 '05 #1
Share this Question
Share on Google+
38 Replies


P: n/a
Jc
Ro****@BeatToBeat.com wrote:
I need this script to advance the document.write by 15 days, as you can see
I tried adding "+ 15"
after the Var Date = today.getDate( ) that works fin until it started
showing 32 days in June
today.


The date constructor can take a number of milliseconds as an argument
to create a date object from. Perhaps this example will be of use:

<script>
var dt = new Date();
var dt2 = new Date(dt.getTime()+15*24*60*60*1000);
alert(dt+"\n"+dt2);
</script>

Refer to:
http://msdn.microsoft.com/library/de...6jsobjdate.asp

Jul 23 '05 #2

P: n/a
Ro****@BeatToBeat.com wrote:
[snip]
document.write(months[month] +' ' + date + ', ' + year);
//-->
</SCRIPT>
---


<script type="text/javascript">
var today = new Date();
today.setDate(today.getDate()+15);
document.write(
['January','February','March','April','May','June', 'July',
'August','September','October','November','Decembe r'][today.getMonth()]+
" "+today.getDate()+
", "+today.getFullYear()
);
</script>

if you find yourself using it a lot, create a Date.prototype

Date.prototype.addDays=function(days){
this.setDate(this.getDate()+days)
// do stuff with the revised date object if you want to.
}

Mick

Mick
Jul 23 '05 #3

P: n/a
Ro****@BeatToBeat.com wrote:
I have a script...
-----
<SCRIPT language="JavaScript" type="text/javascript">
The language attribute is depreciated:

<script type="text/javascript">
<!--
Hiding scripts with HTML comments is unnecessary and potentially
harmful, just don't do it.
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}

function makeArray0() {
for (i = 0; i<makeArray0.arguments.length; i++)
this[i] = makeArray0.arguments[i];
}
Neither of these functions is needed, see below.

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

var months = new
makeArray('January','February','March','April','Ma y','June','July','August','September','October','N ovember','December');
var months = [
'January','February','March','April','May','June',
'July','August','September','October','November',' December'
];
var days = new
makeArray0('Sunday','Monday','Tuesday','Wednesday' ,'Thursday','Friday','Saturday');
var days = [
'Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday'
];
var today = new Date();
Relying on the client PC's clock is unreliable, there are other
strategies, read the group FAQ:

<URL:http://www.jibbering.com/faq>

You can add 15 days directly to the date object:

var today = new Date();
today.setDate(today.getDate()+ 15);
var day = days[today.getDay()];
var date = today.getDate( ) + 15;
var month = today.getMonth() + 1;
var year = y2k(today.getYear());
Delete all the above.
document.write(months[month] +' ' + date + ', ' + year);
document.write(
months[today.getMonth()] + ' '
+ days[today.getDay()] + ' '
+ today.getFullYear()
);
</SCRIPT>
---

I need this script to advance the document.write by 15 days, as you can see
I tried adding "+ 15"
after the Var Date = today.getDate( ) that works fin until it started
showing 32 days in June
today. LOL.


Sorry, but the laugh's on you. The value returned by getDate() is a
number, so adding any other number will give a normal arithmetic
addition.
<script type="text/javascript">

var months = [
'January','February','March','April','May','June',
'July','August','September','October','November',' December'
];

var days = [
'Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday'
];

var today = new Date();
today.setDate(today.getDate()+ 15);

document.write(
days[today.getDay()] + ', '
+ today.getDate() + ' '
+ months[today.getMonth()] + ', '
+ today.getFullYear()
);
</script>

--
Rob
Jul 23 '05 #4

P: n/a
Jc
Jc wrote:
Ro****@BeatToBeat.com wrote:
I need this script to advance the document.write by 15 days, as you can see
I tried adding "+ 15"
after the Var Date = today.getDate( ) that works fin until it started
showing 32 days in June
today.


The date constructor can take a number of milliseconds as an argument
to create a date object from. Perhaps this example will be of use:

<script>
var dt = new Date();
var dt2 = new Date(dt.getTime()+15*24*60*60*1000);
alert(dt+"\n"+dt2);
</script>

Refer to:
http://msdn.microsoft.com/library/de...6jsobjdate.asp


Forgot about setDate, yeah, use that. :)

Jul 23 '05 #5

P: n/a
JRS: In article <9c***************************@msgid.meganewsserve rs.co
m>, dated Fri, 17 Jun 2005 15:32:11, seen in news:comp.lang.javascript,
Ro****@BeatToBeat.com posted :
I have a script...
Delete it, learn javascript, read and understand the newsgroup FAQ, and
start again.

<SCRIPT language="JavaScript" type="text/javascript"> ^^^^^^^^^^^^^^^^^^^^^ not required<!--
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
this[i + 1] = makeArray.arguments[i];
}

function makeArray0() {
for (i = 0; i<makeArray0.arguments.length; i++)
this[i] = makeArray0.arguments[i];
}
Not needed. And if you want the first word to be indexed 0 or 1, use a
parameter rather than two routines, or supply a dummy zeroth entry.

function y2k(number) { return (number < 1000) ? number + 1900 : number; }
Not correct in all systems; see FAQ & sig. Function getFullYear is
generally available; and, if not, can be accurately emulated.

However, since your work is unlikely to be wanted for very long, you can
safely use 2000 + number%100 with a note about its range.

var months = new
makeArray('January','February','March','April','M ay','June','July','August','Se
p
tember','October','November','December');
DO NOT let your posting agent break lines of code; do it yourself.
Posted code should be directly executable.

var months = ['January', 'February', 'March', 'April', 'May',' June',
'July', 'August', 'September', 'October', 'November', 'December']
var days = new
makeArray0('Sunday','Monday','Tuesday','Wednesday ','Thursday','Friday','Saturda
y
');
var days = ['Sunday', 'Monday', 'Tuesday',
'Wednesday', 'Thursday', 'Friday', 'Saturday']
var today = new Date();
var day = days[today.getDay()];
var date = today.getDate( ) + 15;
var month = today.getMonth() + 1;
var year = y2k(today.getYear());

document.write(months[month] +' ' + date + ', ' + year);
Don't use FFF, or anything like it, on the WWW.

I need this script to advance the document.write by 15 days, as you can see
I tried adding "+ 15"
after the Var Date = today.getDate( ) that works fin until it started
showing 32 days in June
today.


So you were, on the previous day, prepared to believe June 31st?

Yes, that's exactly what you asked for, and should have foreseen.

You need to increment the date object, not the day-of-month.

Ignore any response containing 864e5 or its equivalent; it will not be
reliable for all potential users. Consider
function LZ(x) { return (x<0||x>=10?"":"0") + x }

with (new Date()) {
setDate(getDate()+15)
document.writeln(
getFullYear(), '-', LZ(getMonth()+1), '-', LZ(getDate()) ) }

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #6

P: n/a
JRS: In article <42b37997$0$11333$5a62ac22@per-qv1-newsreader-
01.iinet.net.au>, dated Sat, 18 Jun 2005 11:32:02, seen in
news:comp.lang.javascript, RobG <rg***@iinet.net.auau> posted :
Relying on the client PC's clock is unreliable, there are other
strategies, read the group FAQ:

<URL:http://www.jibbering.com/faq>


Which section? 4.30 refers to the page server clock.

My view is that if the date/time matters to the page author's
organisation, then it can be applied to the submitted response after
receipt at the server end; but if otherwise then it's up to the end user
to have his clock set as he wishes.

<FAQENTRY> FAQ 4.17 is in error in the text; the current date is not
unique. The code rightly uses the current GMT/UTC date/time, which is
(near enough) unique (the clock may be corrected backwards [but no
concern for the end of Summer Time]). Also, an "of" should be an "or".

FAQ 4.31, "everytime" -> "every time"

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #7

P: n/a
Dr John Stockton wrote:
JRS: In article <42b37997$0$11333$5a62ac22@per-qv1-newsreader-
01.iinet.net.au>, dated Sat, 18 Jun 2005 11:32:02, seen in
news:comp.lang.javascript, RobG <rg***@iinet.net.auau> posted :

Relying on the client PC's clock is unreliable, there are other
strategies, read the group FAQ:

<URL:http://www.jibbering.com/faq>

Which section? 4.30 refers to the page server clock.


Section 3.2 has "Manipulating times, dates and the lastModified date
and time in javascript:-" followed by a link to your pages, where
there is a section "Some date troubles".

I was highlighting that using the client PC solely to determine the
date or time is not sensible. If the intention is to advise an
approximate delivery time or similar, it may be best to use dates and
times based on some accurate datum convenient to the OP, rather than
the client, then suggest what the equivalent *might* be at the client
location based on the client system date/time and tell the user that
that is how they were calculated.
--
Rob
Jul 23 '05 #8

P: n/a
Ro****@BeatToBeat.com wrote:
I need this script to advance the document.write by 15 days,


Maybe the following script might be of use for you:

var fst = "+15d";
var dte = new Date();
var plusMinus = fst.match(/[+-]\d+[smhdy]/gi);
if (plusMinus) {
var vorz, shrt, val;
var multiplier = {"S":1,"M":60,"H":3600,"d":86400};
for (var i=0; i<plusMinus.length; i++) {
vorz = plusMinus[i].charAt(0) == "+" ? 1 : -1;
shrt = plusMinus[i].charAt(plusMinus[i].length-1);
val = vorz*Number(plusMinus[i].substring(1,plusMinus[i].length-1));
if (shrt == "m")
dte.setMonth(dte.getMonth() + val);
else if (shrt.toLowerCase() == "y")
dte.setFullYear(dte.getFullYear() + val);
else if (multiplier[shrt])
dte.setTime(dte.getTime() + (val*multiplier[shrt]*1000));
}
}
alert(dte);

You may now add or substract seconds, minutes, hours, days, months or
years to your Date object (dte).

Use "+5S" for fst to add 5 seconds, use "-10d" to substract 10 days, use
"-2H" to substract 2 hours etc.
S = Seconds
M = Minutes
H = Hours
d = Days
m = Months
y = Years

Daniel
Jul 23 '05 #9

P: n/a
RobG <rg***@iinet.net.auau> wrote:
Hiding scripts with HTML comments is unnecessary and potentially
harmful, just don't do it.


Why so? It seems to be a rather ubiquitous idiom, and in any case how
else would one hide script from user agents that can't or won't
execute it?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 23 '05 #10

P: n/a
On 20/06/2005 17:04, Christopher Benson-Manica wrote:
RobG <rg***@iinet.net.auau> wrote:
Hiding scripts with HTML comments is unnecessary and potentially
harmful, just don't do it.
Why so?


Potentially harmful? Well for one thing, if the practice continues into
XHTML markup, then authors will be rather shocked to find that their
script really is hidden from browsers - all of them.
It seems to be a rather ubiquitous idiom,
Tag soup is just as pervasive. What's your point?
and in any case how else would one hide script from user agents that
can't or won't execute it?


One wouldn't.

The original point of 'hiding' was to make sure that an old browser
(that is, old at the end of the last century) wouldn't show the contents
of a SCRIPT element. All user agents now in use understand what a SCRIPT
element is, whether they are capable of executing them or not, so this
is entirely unnecessary. The fact that it persists in modern markup
shows just how clueless some people are.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #11

P: n/a
Michael Winter <m.******@blueyonder.co.invalid> wrote:
Potentially harmful? Well for one thing, if the practice continues into
XHTML markup, then authors will be rather shocked to find that their
script really is hidden from browsers - all of them.
We're a long way from XHTML, despite my desires otherwise...
The original point of 'hiding' was to make sure that an old browser
(that is, old at the end of the last century) wouldn't show the contents
of a SCRIPT element. All user agents now in use understand what a SCRIPT
element is, whether they are capable of executing them or not, so this
is entirely unnecessary. The fact that it persists in modern markup
shows just how clueless some people are.


Well, I appreciate the clue :-)

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 23 '05 #12

P: n/a
On 20/06/2005 17:50, Christopher Benson-Manica wrote:
Michael Winter <m.******@blueyonder.co.invalid> wrote:
The fact that [script hiding] persists in modern markup shows just
how clueless some people are.


Well, I appreciate the clue :-)


No offense. ;)

Script 'hiding' has been around for so long that many don't know why it
began in the first place, or that it stopped being necessary years ago.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #13

P: n/a
In article <fj******************@text.news.blueyonder.co.uk >, Michael Winter <m.******@blueyonder.co.invalid> wrote:
The original point of 'hiding' was to make sure that an old browser
(that is, old at the end of the last century) wouldn't show the contents
of a SCRIPT element. All user agents now in use understand what a SCRIPT
element is, whether they are capable of executing them or not, so this
is entirely unnecessary. The fact that it persists in modern markup
shows just how clueless some people are.

Mike


However, several search engines do pay attention to HTML comments and don't
index keywords found inside them. Much modern usage of comment tags around
<script> and <style> code is to prevent search engines from displaying pages
which may contain keywords in the code.
Perhaps there is more than one clue?
--
While my e-mail address is not munged, | T.******@ieee.org
I probably won't read anything sent there. |
Jul 23 '05 #14

P: n/a
On 20/06/2005 18:07, T. Postel wrote:

[snip]
However, several search engines do pay attention to HTML comments and don't
index keywords found inside them.


If you don't want to index a script, then don't put it in a position to
be indexed. In the vast majority of cases, scripts should be served from
a separate file, and not embedded.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #15

P: n/a
Michael Winter <m.******@blueyonder.co.invalid> wrote:
Script 'hiding' has been around for so long that many don't know why it
began in the first place, or that it stopped being necessary years ago.


Does this truly go for all modern browsers, including PDA-based
browsers? I believe we had a situation where some PDA browser
actually crashed on <script> tags, although that wouldn't have been
fixed by script hiding.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 23 '05 #16

P: n/a
On 20/06/2005 19:16, Christopher Benson-Manica wrote:
Michael Winter <m.******@blueyonder.co.invalid> wrote:
Script 'hiding' [...] stopped being necessary years ago.


Does this truly go for all modern browsers, including PDA-based
browsers?


There's absolutely no reason why it shouldn't, but I didn't really mean
to say 'all'. No-one could make that claim.

All a user agent needs to do once it reads a SCRIPT opening tag is
ignore everything until it encounters </ (though </script is probably
safer). Even something that's strapped for resources should have no
problem doing this as it needs to for SGML comments.

The SCRIPT (and STYLE) elements were defined in 1996. If a user agent
written after HTML 3.2 doesn't understand them, then it's broken. But,
as I said elsewhere, if you have a genuine concern, then a better
solution would be to move the script to an external file. Non-trivial
scripts should be separated, anyway.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #17

P: n/a
JRS: In article <d9*************@news.t-online.com>, dated Mon, 20 Jun
2005 13:24:49, seen in news:comp.lang.javascript, Daniel Kirsch
<Iw*****************@gmx.de> posted :
Ro****@BeatToBeat.com wrote:
I need this script to advance the document.write by 15 days,


Maybe the following script might be of use for you:

var fst = "+15d";
var dte = new Date();
var plusMinus = fst.match(/[+-]\d+[smhdy]/gi);
if (plusMinus) {
var vorz, shrt, val;
var multiplier = {"S":1,"M":60,"H":3600,"d":86400};
for (var i=0; i<plusMinus.length; i++) {
vorz = plusMinus[i].charAt(0) == "+" ? 1 : -1;
shrt = plusMinus[i].charAt(plusMinus[i].length-1);
val = vorz*Number(plusMinus[i].substring(1,plusMinus[i].length-1));
if (shrt == "m")
dte.setMonth(dte.getMonth() + val);
else if (shrt.toLowerCase() == "y")
dte.setFullYear(dte.getFullYear() + val);
else if (multiplier[shrt])
dte.setTime(dte.getTime() + (val*multiplier[shrt]*1000));
}
}
alert(dte);


Not good.

If new Date('2005/10/21'); is used, then, since there are 31 days in
October, the answer should be November 5th. However, if executed in the
EU or in much of North America, the result will be in November 4th.

Did you not see that I warned the OP "Ignore any response containing
864e5 or its equivalent;"?

See below.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #18

P: n/a
T. Postel wrote:
Michael Winter wrote:
The original point of 'hiding' was to make sure that an
old browser (that is, old at the end of the last century)
wouldn't show the contents of a SCRIPT element. All user
agents now in use understand what a SCRIPT element is,
whether they are capable of executing them or not, so
this is entirely unnecessary. The fact that it persists
in modern markup shows just how clueless some people are.
However, several search engines do pay attention to HTML
comments and don't index keywords found inside them.


Not indexing the contents of comments in HTML seems like a perfectly
reasonable thing for a search engine to do. They are unlikely to contain
anything of relevance to someone doing any sort of search.
Much modern usage of comment tags around <script> and
<style> code is to prevent search engines from displaying
pages which may contain keywords in the code.
Is this true? Strictly speaking what appear to be HTML comments within
SCRIPT and STYLE elements are not comments at all because the contents
of those elements are CDATA so the HTML comment-like delimiters are no
more than sequences of charters that resemble HTML comments. They only
get to be HTML comments when the parser has no understanding of SCRIPT
and STYLE elements.

Now SCRIPT and STYLE elements have been with us for some considerable
time, and browsers at least have understood how to handle them (either
using them or ignoring their contents) for almost as long.

So how does the writer of an HTML parser for a search engine come to be
unfamiliar with the nature of SCIPT and STYLE elements? And how does the
resulting search engine perform when it is diluting its usefulness
considering identifiers, script comments and CSS class names.

This sounds more like someone inventing a fairly tail to justify doing
something that they could not find any other reason for doing. An
nothing short of search engine documentation stating that they index
SCRIPT and STYLE element content will convince me otherwise.
Perhaps there is more than one clue?


Or a second type of clueless.

Richard.
Jul 23 '05 #19

P: n/a
Dr John Stockton wrote:
Not good.

If new Date('2005/10/21'); is used, then, since there are 31 days in
October, the answer should be November 5th. However, if executed in the
EU or in much of North America, the result will be in November 4th.

Did you not see that I warned the OP "Ignore any response containing
864e5 or its equivalent;"?


Thanks. Added
if (shrt == "d")
dte.setDate(dte.getDate() + val);

Anything else "not good"?

Daniel
Jul 23 '05 #20

P: n/a
Michael Winter <m.******@blueyonder.co.invalid> wrote:
All a user agent needs to do once it reads a SCRIPT opening tag is
ignore everything until it encounters </


Pedantry: Actually, "</" followed by a name start character (a-zA-Z),
i.e. ETAGO delmiter-in-context, or NET ("/") if the start tag was NET-
enabling.

--
David Håsäther
Jul 23 '05 #21

P: n/a
JRS: In article <d9*************@news.t-online.com>, dated Tue, 21 Jun
2005 11:26:55, seen in news:comp.lang.javascript, Daniel Kirsch
<Iw*****************@gmx.de> posted :
Dr John Stockton wrote:
Not good.

If new Date('2005/10/21'); is used, then, since there are 31 days in
October, the answer should be November 5th. However, if executed in the
EU or in much of North America, the result will be in November 4th.

Did you not see that I warned the OP "Ignore any response containing
864e5 or its equivalent;"?


Thanks. Added
if (shrt == "d")
dte.setDate(dte.getDate() + val);

Anything else "not good"?


Well, the RegExp test should perhaps be case-sensitive; and you need to
think about what +3H should do to Sun 2005/10/30 00:00:00. As you have
it, it gives 2 o'clock; but with setHours it would give 3 o'clock.

If the change cannot be done, the date should possibly be set to NaN.

vorz = plusMinus[i].charAt(0) == "+" ? 1 : -1;
or vorz = plusMinus[i].charAt(0) + "1" // ??

Actually, you don't need vorz; RegExp match with
X = fst.match(/([+-]\d+)([SMHdmy])/)
then +X[1] can be used as val and X[2] as the selector.

Note that a minute after 2005/10/30 01:59:30 it is actually 2005/10/30
01:00:30.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #22

P: n/a
Dr John Stockton wrote:
Well, the RegExp test should perhaps be case-sensitive; and you need to
think about what +3H should do to Sun 2005/10/30 00:00:00. As you have
it, it gives 2 o'clock; but with setHours it would give 3 o'clock.
Of course. But that's pretty theoretical :-)
Actually, you don't need vorz; RegExp match with
X = fst.match(/([+-]\d+)([SMHdmy])/)
then +X[1] can be used as val and X[2] as the selector.
Thanks.

Note that a minute after 2005/10/30 01:59:30 it is actually 2005/10/30
01:00:30.


Works for me. It gives me "2:00:30".

Daniel
Jul 23 '05 #23

P: n/a
JRS: In article <d9*************@news.t-online.com>, dated Wed, 22 Jun
2005 15:19:02, seen in news:comp.lang.javascript, Daniel Kirsch
<Iw*****************@gmx.de> posted :
Dr John Stockton wrote:

Note that a minute after 2005/10/30 01:59:30 it is actually 2005/10/30
01:00:30.


Works for me. It gives me "2:00:30".


Yes; but you're presumably in Germany. Try it in German time, a clock
hour later.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
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 moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #24

P: n/a
> Michael Winter <m.win...@blueyonder.co.invali*d> wrote:
Script 'hiding' has been around for so long that many don't know why it

began in the first place, or that it stopped being necessary years ago.

I wonder if you can say the same about multi-line comment tags around
CDATA open and close tags placed in a script in a few years. In xhtml
you are required to surround the script with open and close CDATA tags
to avoid possible conflict with xml, if any is included in the xhtml
page. The problem is that most current browsers do not understand the
xml CDATA tags and completely kill the script, if you use them. The W3C
xhtml 1.0 and 1.1 validators will validate such a page perfectly, if it
has no errors. However if you leave the CDATA tags off, the validators
make a terrible fuss. However if you surround the CDATA open and close
tags with the multi-line javascript tags, everyone is happy. The page
works, and the validators and a proper xhtml delivery see right through
the javascripts to view the XML CDATA tags. I believe I first learned
about this at the Opera forum nearly 2 years ago from a member of the
Opera design team. Of course the easy way out is to use an external
javascript file, which avoids all of this fuss. However, many still
insist on including the script on the main page.

PS The Google beta groups site has been acting up at times for the last
day or two. It sometimes does not put the quoted message in the text
box, and you have to highlight and copy it to the response text box.
Until this problem resolves, some posts made from Google are going to
look strange. Major US ISPs including MSN and AOL have dropped Usenet
groups. I and many others are not interested in newsreaders just to
make a few posts in Usenet. Nearly everyone I know reads NGs online.
Most plans here allow unlimited, or very large, time on line, and many
even with dialup leave the computer on for many hours at a time.

Jul 23 '05 #25

P: n/a
On 23/06/2005 09:40, cw******@yahoo.com wrote:

[snip]
The problem is that most current browsers do not understand the
xml CDATA tags and completely kill the script, if you use them.


The rather blatantly obvious solution is to not serve XHTML(-like)
documents to user agents that don't explicitly state[1] they support it.

There is no benefit in serving XHTML as text/html, and XML tools can
transform their output to HTML so there is no excuse here, either.

[snip]

Mike
[1] IE says it supports anything in its request headers, so you have to
ignore things like that when negotiating XHTML.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #26

P: n/a
JRS: In article <11*********************@g47g2000cwa.googlegroups. com>,
dated Thu, 23 Jun 2005 01:40:20, seen in news:comp.lang.javascript,
cw******@yahoo.com <cw******@yahoo.com> posted :

PS The Google beta groups site has been acting up at times for the last
day or two. It sometimes does not put the quoted message in the text
box, and you have to highlight and copy it to the response text box.
Until this problem resolves, some posts made from Google are going to
look strange. Major US ISPs including MSN and AOL have dropped Usenet
groups. I and many others are not interested in newsreaders just to
make a few posts in Usenet. Nearly everyone I know reads NGs online.
Most plans here allow unlimited, or very large, time on line, and many
even with dialup leave the computer on for many hours at a time.


If providers in your country provide only shoddy services, it is you who
should suffer, not us; you merit no sympathy. Pay for a good service,
and demand it.
If you find that, when you start a News reply, Google does not provide
the previous article in quoted form, note what Keith Thompson wrote in
comp.lang.c, message ID <ln************@nuthaus.mib.org> :-
If you want to post a followup via groups.google.com, don't use
the "Reply" link at the bottom of the article. Click on "show
options" at the top of the article, then click on the "Reply" at
the bottom of the article headers.

Since that is what the experts in this newsgroup prefer to read, it will
be to your advantage to comply.

--
© John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jul 23 '05 #27

P: n/a
Dr John Stockton wrote:
JRS: In article <d9*************@news.t-online.com>, dated Wed, 22 Jun
2005 15:19:02, seen in news:comp.lang.javascript, Daniel Kirsch
<Iw*****************@gmx.de> posted :
Dr John Stockton wrote:
Note that a minute after 2005/10/30 01:59:30 it is actually 2005/10/30
01:00:30.

Works for me. It gives me "2:00:30".


Yes; but you're presumably in Germany. Try it in German time,
a clock hour later.


I am in Germany where next change from Daylight Saving Time to
"normal" time is scheduled on Sunday, 2005-10-30, 03:00:00.000
local (DS)time, using the German time locale.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050610
Firefox/1.0.4 (Debian package 1.0.4-3) Mnenhy/0.7.2.0

shows for `new Date(2005, 9, 30, 1, 59)'
"Sun Oct 30 2005 01:59:00 GMT+0200 (CEST)"
which is correct;

for `new Date(2005, 9, 30, 2, 59)'
"Sun Oct 30 2005 02:59:00 GMT+0100 (CET)"
which is incorrect

and so for `new Date(new Date(2005, 9, 30, 2, 59).getTime() + 3600000)'
"Sun Oct 30 2005 03:59:00 GMT+0100 (CET)"
which is correct according to "common sense".

Apparently, the JavaScript 1.5 engine of my UA is not up to date or not
properly using the locale. The second expression should have given

"Sun Oct 30 2005 02:59:00 GMT+0200 (CEST)"

as change from local DST to local "normal" time is scheduled only a
minute later (ref. <http://zeitumstellung.de/>). Or am I missing
something?
PointedEars
Jul 23 '05 #28

P: n/a
cw******@yahoo.com wrote:
Michael Winter <m.win...@blueyonder.co.invali*d> wrote:
Script 'hiding' has been around for so long that many don't know why it began in the first place, or that it stopped being necessary years ago.

^^
This quote is borken, although Google Groups may error-correct that for
display. The technical flaws of Google Groups posts are many, especially
in the new version; please avoid using it, use a proper newsreader
application instead.
I wonder if you can say the same about multi-line comment tags around
CDATA open and close tags placed in a script in a few years. In xhtml
you are required to surround the script with open and close CDATA tags
to avoid possible conflict with xml, if any is included in the xhtml
page.


No, you are not. As it is but a PCDATA issue, you may instead escape markup
characters within the PCDATA content that script or style content is in
XHTML, e.g. `&lt;' for `<' (JS: less-than operator; CSS: child selector),
&gt; for `>' (JS: greater-than operator) and so on.

It is only that the UA(s) tested with or targeted, most notably Internet
Explorer, are not capable of processing XHTML and so do not support CDATA
_content declarations_ which is why commenting out those declarations is
necessary; not using the unsupported markup language in the first place
(but sticking to widely, if not always, supported HTML 4.01, Strict DTD
if possible) or including/linking to a script or style file would have
avoided the original problem.
PointedEars
Jul 23 '05 #29

P: n/a
JRS: In article <47****************@PointedEars.de>, dated Sun, 3 Jul
2005 19:40:18, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted :
Dr John Stockton wrote: (about ten days ago)
JRS: In article <d9*************@news.t-online.com>, dated Wed, 22 Jun
2005 15:19:02, seen in news:comp.lang.javascript, Daniel Kirsch
<Iw*****************@gmx.de> posted :
Dr John Stockton wrote:
Note that a minute after 2005/10/30 01:59:30 it is actually 2005/10/30
01:00:30.
Works for me. It gives me "2:00:30".


Yes; but you're presumably in Germany. Try it in German time,
a clock hour later.


I am in Germany


Apparently, the JavaScript 1.5 engine of my UA is not up to date or not
properly using the locale. The second expression should have given

"Sun Oct 30 2005 02:59:00 GMT+0200 (CEST)"

as change from local DST to local "normal" time is scheduled only a
minute later (ref. <http://zeitumstellung.de/>). Or am I missing
something?


Probably.

Rather than looking at such as
new Date(2005, 9, 30, 1, 59)
it would be simpler to look at
new Date(2005, 9, 30, 1, 59).getTimezoneOffset()
or
new Date("2005/10/30 00:59:00 GMT").getTimezoneOffset()

One can get javascript to determine when the clock change is thought to
occur : <URL:http://www.merlyn.demon.co.uk/js-clndr.htm#Ctrls> shows it.

Unfortunately, operating systems are often written and configured in a
country which has a considerable reputation for ignorance both about
time and about the rest of the world; so your OS may have incorrect
data.
You wrote :
for `new Date(2005, 9, 30, 2, 59)'
"Sun Oct 30 2005 02:59:00 GMT+0100 (CET)"
which is incorrect
Is it? Local time 02:59 occurs twice, once at the end of Summer and
once at the start of Winter, and ISTM that you see the latter. After
the clock has been put back, it continues going forwards.

Indeed, AIUI, the first version of Windows 95 (cf. ibid. 13,14/19) sets
the clock back whenever it thinks that the clock has reached 2 a.m. on
the day in question, not just on the first occasion.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
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 moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #30

P: n/a
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
Dr John Stockton wrote:
[...] Daniel Kirsch [...] posted :
Dr John Stockton wrote:
> Note that a minute after 2005/10/30 01:59:30 it is actually
> 2005/10/30 01:00:30.
Works for me. It gives me "2:00:30".
Yes; but you're presumably in Germany. Try it in German time,
a clock hour later. I am in Germany [...]
(Please use at least ellipses for omitted text, thanks.)
Apparently, the JavaScript 1.5 engine of my [Firefox 1.0.4 on
GNU/Linux] is not up to date or not properly using the locale.
[`new Date(2005, 9, 30, 2, 59)'] should have given
"Sun Oct 30 2005 02:59:00 GMT+0200 (CEST)"

as change from local DST to local "normal" time is scheduled only a
minute later (ref. <http://zeitumstellung.de/>). Or am I missing
something?


Probably.

Rather than looking at such as
new Date(2005, 9, 30, 1, 59)
it would be simpler to look at
new Date(2005, 9, 30, 1, 59).getTimezoneOffset()


-120

in [1] Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8)
Gecko/20050511 Firefox/1.0.4

and

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
or new Date("2005/10/30 00:59:00 GMT").getTimezoneOffset()
The same as above in both UAs.
One can get javascript to determine when the clock change is thought
to occur : <URL:http://www.merlyn.demon.co.uk/js-clndr.htm#Ctrls>
shows it.
[1] shows

| Summer Time according to your system :-
| Sun, 27 Mar 2005 01:00:00 GMT on off
| Sun, 30 Oct 2005 01:00:00 GMT

in Firefox 1.04/Win+GNU/Linux and

| Summer Time according to your system :-
| Sun, 27 Mar 2005 01:00:00 UTC on off
| Sun, 30 Oct 2005 01:00:00 UTC

in IE 6/Win.
Unfortunately, operating systems are often written and configured in
a country which has a considerable reputation for ignorance both
about time and about the rest of the world; so your OS may have
incorrect data.
It has not, other apps performed the change appropriately.
You wrote :
for `new Date(2005, 9, 30, 2, 59)'
"Sun Oct 30 2005 02:59:00 GMT+0100 (CET)"
which is incorrect
Is it?
(Please use quote characters in front of lines to indicate
quoted text, thanks.)

I do think so, because of the wrong time zone offset. It is GMT+0100
and should be GMT+0200, since local DST did not end yet.
Local time 02:59 occurs twice, once at the end of Summer and
once at the start of Winter,
You're right,
and ISTM that you see the latter.


however getTimezoneOffset() of the same date returns -120. It
should be either -60 (to indicate that local DST ended before)
or the string representation should yield

Sun Oct 30 2005 02:59:00 GMT+0200 (CEST)
PointedEars
Jul 23 '05 #31

P: n/a
JRS: In article <21****************@PointedEars.de>, dated Sun, 10 Jul
2005 21:04:22, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted, to an old thread :
You wrote :
for `new Date(2005, 9, 30, 2, 59)'
"Sun Oct 30 2005 02:59:00 GMT+0100 (CET)"
which is incorrect
Is it?
I do think so, because of the wrong time zone offset. It is GMT+0100
and should be GMT+0200, since local DST did not end yet.


On that day, at 2:59 #1 local, it is still summer time - don't use DST,
it is a merkinism; use the British or German term - preferably the
former, since British introduced it first - and the clock goes back a
minute later to 2:00 local, and about an hour later it shows 2:59 #2.

AIUI, German law, unless since upset by the EU, defines these hours as
starting at 02:00 "A" & "B".

Therefore on that day the third and fourth hours of the day occur at the
same local time, and the choice of UTC for a given local time is
arbitrary by an hour.

Inversely, for me both
new Date("2005/03/27 01:30")
new Date("2005/03/27 02:30")
give, on default string conversion, Sun Mar 27 01:30:00 UTC 2005 ; in a
better world, the first would give NaN. Perhaps it does in other
browsers.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #32

P: n/a
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted [...]:
You wrote :
for `new Date(2005, 9, 30, 2, 59)'
"Sun Oct 30 2005 02:59:00 GMT+0100 (CET)"
which is incorrect
Is it? I do think so, because of the wrong time zone offset. It is GMT+0100
and should be GMT+0200, since local DST did not end yet.


On that day, at 2:59 #1 local, it is still summer time


I did not state the opposite, on the contrary.
- don't use DST, it is a merkinism;
Not Google, none of my many English printed and online dictionaries, not
even the Wikipedia, which tends to be comprehensive and verbose, really
explains that term. Would you do it, please?
use the British or German term - preferably the former, since British
introduced it first
Sources are contradictory but it turns out that your information is probably
incorrect:

,-<http://en.wikipedia.org/wiki/Daylight_saving_time>
| [...]
| It was first seriously proposed by William Willett in the "Waste of
| Daylight" [2], published in 1907, but he was unable to get the British
| government to adopt it, despite considerable lobbying.
|
| [...]
| The idea of daylight saving time was first put into practice by the German
| government during the First World War between April 30, 1916 and October
| 1, 1916. Shortly afterward, the United Kingdom followed suit, first
| adopting DST between May 21, 1916 and October 1, 1916. [...]

Most interestingly, the German Wikipedia's "Sommerzeit" article suggests
that "Daylight Saving Time" (sic!) was introduced first in the former Irish
Republic shortly after the Easter Rising in 1916 AD. Although the Irish
fought for independence, technically speaking Ireland was then still a part
of the UK which would explain the second sentence in the first source as
well as your statement. I take it that the rest of the UK introduced it
after the Truce in 1921. (DST was introduced in the Federal Republic of
Germany late in 1980, mostly as a reaction to the energy crisis of 1973
and to conform with the other countries that introduced it earlier.)

DST/ST was primarily introduced to save electric energy (yes, energy cannot
be saved, only transformed) in summer when the days (i.e. the time between
sunrise and sunset) are of course longer in the (Central European) summer
months than in the winter months. Switching local time ahead one hour in
the summer months allows to make better use of sunlight during normal
working hours.

Therefore I consider the original term, Daylight Saving Time, the more
correct one, "summer time" (in German: "Sommerzeit") is rather a colloquial
form of that although I do recognize that "British Summer Time (BST)" as
well as "Irish Summer Time (IST)" are known terms for DST in Britain and in
the Republic of Ireland.

(However, DST has been and is still questionable: statistics show that
indeed less electric energy is consumed (or rather: transformed) in the
evenings but also more energy is consumed/transformed with heating in the
morning hours, especially in the colder months of March, April and October.
Additionally, the change has a yet underestimated impact on the biorhythm
and so the health of many individuals, especially shift workers. Last but
not least, in a global economy there is not much point in referring to
local time when it comes to working hours, DST rather introduces confusion
in normal business. But that kind of discussion also does not really
belong here.)
- and the clock goes back a minute later to 2:00
local, and about an hour later it shows 2:59 #2.

AIUI, German law, unless since upset by the EU, defines these hours as
starting at 02:00 "A" & "B".


I do not understand what you mean with "'A' & 'B'".

Anyway, DST in the Federal Republic of Germany (which happens to be
my home country) is standardized and enforced by the "Gesetz über die
Zeitbestimmung"/ "Zeitgesetz" (Law Regarding the Definition of Time/
Time Law) since 1980, currently to start at 0200 CET/0100 GMT and end at
_0300_ CEST/0200 CET/0100 GMT (thus implementing the European Community
directive 2000/84/EG), see e.g. <http://zeitumstellung.de/> (from your
postings in de.comp.lang.javascript I understand that you understand at
least a bit German).

So, to be at least a bit on-topic here:

That means if the implementation would take heed of what the OS already
"knows", consequently, it would show "...02:59:00+02:00 CEST" _and_ a time
zone offset of -120 for the given date, not only one of them. It does not.

While ECMAScript does not require a conforming implementation to take heed
of local DST changes, I consider it a JS bug that the time zone offset in
the string representation and the time zone offset retrieved using the
object's method differ for the same Date object. But this merely
emphasizes your point that a date computation performed with JS has to be
watched for DST change.
PointedEars
Jul 23 '05 #33

P: n/a
JRS: In article <23****************@PointedEars.de>, dated Mon, 11 Jul
2005 21:31:02, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted :
Dr John Stockton wrote: Sources are contradictory but it turns out that your information is probably
incorrect:

,-<http://en.wikipedia.org/wiki/Daylight_saving_time>
Don't rely on Wikipedia[*]. And, independently of that, don't rely on
information on locations outside the USA that is, or may have been, US-
sourced.

| The idea of daylight saving time was first put into practice by the German
| government
Incorrect.
during the First World War between April 30, 1916 and October
| 1, 1916. Shortly afterward, the United Kingdom followed suit, first
| adopting DST between May 21, 1916 and October 1, 1916. [...]
No. The UK adopted Summer Time, but not its future murrican acronym.
And that quote is badly written, since 1916-05-21 was not after
1916-10-01. No ambiguity, but an avoidable infelicity.

I take it that the rest of the UK introduced it
after the Truce in 1921.
Incorrect.

AIUI, German law, unless since upset by the EU, defines these hours as
starting at 02:00 "A" & "B".
I do not understand what you mean with "'A' & 'B'".


They are letters of the alphabet; used (I have read) to discriminate
between the first and second occurrences of the ambiguous civil hour.

Anyway, DST in the Federal Republic of Germany (which happens to be
my home country) is standardized and enforced by the "Gesetz über die
Zeitbestimmung"/ "Zeitgesetz" (Law Regarding the Definition of Time
...
Not really true. It is standardised by the EU in Brussels; Germany is
obliged to comply. In spite of the events of 1914 & 1940, Germany is
now ruled from Brussels.
So, to be at least a bit on-topic here:

That means if the implementation would take heed of what the OS already
"knows", consequently, it would show "...02:59:00+02:00 CEST" _and_ a time
zone offset of -120 for the given date, not only one of them. It does not.

While ECMAScript does not require a conforming implementation to take heed
of local DST changes,
ECMAscript explicitly expects that it will do so; but in practice it
will have to rely on the OS to provide the information, and, no doubt,
ECMA was aware that it would not always be practical to do so. Consider
what you might do if you were to take a portable on a short visit to Tel
Aviv, since AIUI Israeli law is not compatible with ECMA 262 15.9.1.9
(and, up to a decade or two ago, UK law was not, either). Rightly, ECMA
has not declared the impracticable to be mandatory.

I consider it a JS bug that the time zone offset in
the string representation and the time zone offset retrieved using the
object's method differ for the same Date object.


That, if true, is not a javascript bug; it is a javascript
implementation bug.

In my IE4, which is misinformed by Windows 98 about the UTC of the
transition believing it to be at 02:00 UTC,

document.writeln('<pre>')
for ( K=-1 ; K<9 ; K++ ) {
D = new Date(Date.UTC(2005, 10-1, 30, 0, 15 + 30*K))
document.writeln(D.getTimezoneOffset(), '\t', D.UTCstr(), '\t', D)
}
document.writeln('</pre>')

(UTCstr is shown in js-nclds.htm) gives :

-60 2005-10-29 23:45:00 Sun Oct 30 00:45:00 UTC+0100 2005
-60 2005-10-30 00:15:00 Sun Oct 30 01:15:00 UTC+0100 2005
-60 2005-10-30 00:45:00 Sun Oct 30 01:45:00 UTC+0100 2005
-60 2005-10-30 01:15:00 Sun Oct 30 02:15:00 UTC+0100 2005
-60 2005-10-30 01:45:00 Sun Oct 30 02:45:00 UTC+0100 2005
0 2005-10-30 02:15:00 Sun Oct 30 02:15:00 UTC 2005
0 2005-10-30 02:45:00 Sun Oct 30 02:45:00 UTC 2005
0 2005-10-30 03:15:00 Sun Oct 30 03:15:00 UTC 2005
0 2005-10-30 03:45:00 Sun Oct 30 03:45:00 UTC 2005
0 2005-10-30 04:15:00 Sun Oct 30 04:15:00 UTC 2005

which is entirely self-consistent; I do not see any error such as you
assert. With that code, you should see offsets -60 minutes "greater",
the same UTC column, local times an hour "later" with offsets an hour
greater.

BTW, to describe BST as UTC+0100 seems reasonable. To describe
Sommerzeit as "<time>+02:00 CEST" does not; "<time> CEST [UTC]+02[:]00"
would.
Never trust software of US origin to handle dates and times rationally
or efficiently; nor to do so correctly outside the USA.
[*] Unless recently corrected, de.wiki has an error in its Zeller
material; the author has not understood the source he cites. Plain wiki
lacks the material to have the error in.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
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 moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #34

P: n/a
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
Sources are contradictory but it turns out that your information is
probably incorrect:
,-<http://en.wikipedia.org/wiki/Daylight_saving_time>
Don't rely on Wikipedia[*]. And, independently of that, don't rely on
information on locations outside the USA that is, or may have been, US-
sourced.


Your demonstrated paranoia regarding anything non-UK is somewhat refreshing.
For a while.
| The idea of daylight saving time was first put into practice by the
| German government


Incorrect.


You have yet to prove that.
during the First World War between April 30, 1916 and October
| 1, 1916. Shortly afterward, the United Kingdom followed suit, first
| adopting DST between May 21, 1916 and October 1, 1916. [...]


No. The UK adopted Summer Time, but not its future murrican acronym.


Whatever "murrican" means again.
And that quote is badly written,
A matter of perspective.
since 1916-05-21 was not after 1916-10-01.
I don't argue with that.
No ambiguity, but an avoidable infelicity.
That is probably the time it was introduced in parliament and the time it
was ratified.
I take it that the rest of the UK introduced it after the Truce in 1921.


Incorrect.


Yes, after I have done further research, that is probably the case.
Anyway, DST in the Federal Republic of Germany (which happens to be
my home country) is standardized and enforced by the "Gesetz über die
Zeitbestimmung"/ "Zeitgesetz" (Law Regarding the Definition of Time
...


Not really true.


YMMD. *You* *really* tell *me* what's going on in *my* home country!
It is standardised by the EU in Brussels; Germany is obliged to comply.
You want to either read more carefully or get informed before you make
further such claims. The "Zeitgesetz" existed long before (1980) the EC/EU
directive (2000). It was adapted to comply to the directive, that's all.
In spite of the events of 1914 & 1940, Germany is now ruled from Brussels.
I really don't know what to reply to such a piece of junk. ISTM that you
have either been just badly misinformed and believe anything that you are
exposed to except in this group (maybe you are part of some extreme
circles, I don't really care), you are trolling, or you are just foolish
enough to believe that anyone believes what you say. JFTR: Many laws
(AFAIK about 70%) that affect Germany originate from Brussels nowadays,
but that does not make the country in any way ruled from there; many of
the EU laws have to be ratified by the German Bundestag (in Berlin) before
they become active law in Germany.

I could post the URL of an excellent Wikipedia article that could manage
to explain that to you more in detail but then I doubt you will even bother
to follow the link, let alone carefully reading it.
So, to be at least a bit on-topic here:

That means if the implementation would take heed of what the OS already
"knows", consequently, it would show "...02:59:00+02:00 CEST" _and_ a
time zone offset of -120 for the given date, not only one of them. It
does not.

While ECMAScript does not require a conforming implementation to take
heed of local DST changes,


ECMAscript explicitly expects that it will do so; [...]


No, it does not. Read ECMAScript ed. 3, section 15.9.1.8 carefully again.
I consider it a JS bug that the time zone offset in the string
representation and the time zone offset retrieved using the
object's method differ for the same Date object.


That, if true, is not a javascript bug; it is a javascript
implementation bug.


Splitting hairs again?
Never trust software of US origin to handle dates and times rationally
or efficiently; nor to do so correctly outside the USA.
Fortunately you don't have allowed your judgement to be clouded by an
extreme nationalist attitude and do not show a strong tendence towards
xenophobia.
[*] Unless recently corrected, de.wiki has an error in its Zeller
material; the author has not understood the source he cites. Plain
wiki lacks the material to have the error in.


You, as any person that understands the used language, are
in a position to change that, even without registering.
PointedEars
Jul 23 '05 #35

P: n/a
JRS: In article <21****************@PointedEars.de>, dated Wed, 13 Jul
2005 00:17:48, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted :
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [...] posted :
Sources are contradictory but it turns out that your information is
probably incorrect:
,-<http://en.wikipedia.org/wiki/Daylight_saving_time>
Don't rely on Wikipedia[*]. And, independently of that, don't rely on
information on locations outside the USA that is, or may have been, US-
sourced.


Your demonstrated paranoia regarding anything non-UK is somewhat refreshing.


It appears that you have not understood that sentence. The Americans
are notoriously unreliable in understanding the ways of the rest of the
world.

| The idea of daylight saving time was first put into practice by the
| German government


Incorrect.


You have yet to prove that.


You have yet to follow the indications given to you. Your Web searching
technique is inadequate. And you have shown no sign at all of having
considered the implications of setting clocks back on 1915-09-26.

I take it that the rest of the UK introduced it after the Truce in 1921.


Incorrect.


Yes, after I have done further research, that is probably the case.


You see, even you can show yourself to be in error!

Anyway, DST in the Federal Republic of Germany (which happens to be
my home country) is standardized and enforced by the "Gesetz über die
Zeitbestimmung"/ "Zeitgesetz" (Law Regarding the Definition of Time
...


Not really true.


YMMD. *You* *really* tell *me* what's going on in *my* home country!
It is standardised by the EU in Brussels; Germany is obliged to comply.


You want to either read more carefully or get informed before you make
further such claims. The "Zeitgesetz" existed long before (1980) the EC/EU
directive (2000). It was adapted to comply to the directive, that's all.


You need to consider the difference between "is" and "was". Germany was
competent to organise its own clocks; it is no longer allowed to do so.
The present Germany is about as independent as East Germany used to be.

many of
the EU laws have to be ratified by the German Bundestag (in Berlin) before
they become active law in Germany.


Indeed; but in very many cases that ratification is obligatory.

Never trust software of US origin to handle dates and times rationally
or efficiently; nor to do so correctly outside the USA.


Fortunately you don't have allowed your judgement to be clouded by an
extreme nationalist attitude and do not show a strong tendence towards
xenophobia.


When you are in less of a temper, you can write quite passable English.
But not necessarily, it appears, otherwise.

[*] Unless recently corrected, de.wiki has an error in its Zeller
material; the author has not understood the source he cites. Plain
wiki lacks the material to have the error in.


You, as any person that understands the used language, are
in a position to change that, even without registering.


I don't *write* German. Those who read the de.wiki may see the error
themselves, or find it by other means; it is explained in the linked
material that the author of the German used. It's your language; you
fix it. If you refuse, maybe Martin might consider doing it.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
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 moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #36

P: n/a
Dr John Stockton wrote:
The Americans
are notoriously unreliable in understanding the ways of the rest of
the world.


Dear Doctor,

Your bigotry and persistent prejudiced generalizations about individuals
based on their country of origin has been demonstrated sufficiently on this
newsgroup.

Having embarassed yourself enough, we strongly recommend that you stop being
such an arrogant asshole.

Thank you,

The Management
Jul 23 '05 #37

P: n/a
Matt Kruse wrote on 13 jul 2005 in comp.lang.javascript:
Dr John Stockton wrote:
The Americans
are notoriously unreliable in understanding the ways of the rest of
the world.


Dear Doctor,

Your bigotry and persistent prejudiced generalizations about
individuals based on their country of origin has been demonstrated
sufficiently on this newsgroup.

Having embarassed yourself enough, we strongly recommend that you stop
being such an arrogant asshole.

Thank you,

The Management


While the management debases itself with such coarse language,
I will side with the Doctor, as his value to this NG is beond measure.

One could certainly wonder where the management is based. Would the
management be so angry, if it did not feel a schred of truth in the
doctor's words? Moreover, being "notoriously unreliable" only states the
notoriousness of the unreliability, not the unreliability itself.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #38

P: n/a
Matt Kruse wrote:
[snip]
Your bigotry and persistent prejudiced generalizations about individuals
based on their country of origin has been demonstrated sufficiently on this
newsgroup.

Having embarassed yourself enough, we strongly recommend that you stop being
such an arrogant asshole.

[snip]

Do you not recognize the good natured "tongue-in-cheekness" of the good
doctor's responses?
Mick.
Jul 23 '05 #39

This discussion thread is closed

Replies have been disabled for this discussion.