468,507 Members | 1,602 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,507 developers. It's quick & easy.

Date Bug??? Need help:-)

Hi all,

Why do I get the folowing date when creating it like so:

var d = new Date(2003,9,2);
Wed Oct 1 23:00:00 UTC+0200 2003

Isent it soposed to be:

Thu Oct 2 00:00:00 UTC+0200 2003

Thaks ;-)
Jul 20 '05 #1
8 2861
"Shlomi Schwartz" <s_******@lycos.com> schreef in bericht
news:10**************************@posting.google.c om...
Hi all,

Why do I get the folowing date when creating it like so:

var d = new Date(2003,9,2);
Wed Oct 1 23:00:00 UTC+0200 2003

Isent it soposed to be:

Thu Oct 2 00:00:00 UTC+0200 2003


Yes it is,

I made this file:

<html>
<body>
<script>
var d = new Date(2003,9,2);
document.write(d);
</script>

And the output was:: Thu Oct 2 00:00:00 UTC+0200 2003

Was this the same look like source you used?

Jul 20 '05 #2
JRS: In article <10**************************@posting.google.com >, seen
in news:comp.lang.javascript, Shlomi Schwartz <s_******@lycos.com>
posted at Sun, 12 Oct 2003 06:59:24 :-
Why do I get the folowing date when creating it like so:

var d = new Date(2003,9,2);
Wed Oct 1 23:00:00 UTC+0200 2003

Isent it soposed to be:

Thu Oct 2 00:00:00 UTC+0200 2003


Not necessarily; I get Thu Oct 2 00:00:00 UTC+0100 2003 which is
of course an hour later. I assume that you are French, or equivalent.

You should have given sample code, and, as is generally wise when
dealing with dates, the localisation of your browser - or at least that
of the one which fails to satisfy you. And, if you really suspect the
browser, you should identify it.

Perhaps you are really doing new Date(2003, 9, 2, -1).

--
© 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 20 '05 #3
Hi all,

Thanks for the fast replay, Problem solved.

Because of religious reason ISRAEL (my location) ,Daylight saving clock starts
two weeks before the rest of the world.

So when I unchecked the "Automatically adjust clock for daylight saving"
It worked fine.
Thanks again ;-)
Jul 20 '05 #4
Hi all,

Thanks for the fast replay, Problem solved.

Because of religious reason ISRAEL (my location) ,Daylight saving clock starts
two weeks before the rest of the world.

So when I unchecked the "Automatically adjust clock for daylight saving"
It worked fine.
Thanks again ;-)
Jul 20 '05 #5
JRS: In article <10**************************@posting.google.com >, seen
in news:comp.lang.javascript, Shlomi Schwartz <s_******@lycos.com>
posted at Mon, 13 Oct 2003 03:24:51 :-
Because of religious reason ISRAEL (my location) ,Daylight saving clock starts
two weeks before the rest of the world.


It does not.

It cannot do so, because the rest of the world does not all start on the
same date. For example, the Americans start a week late; and the
Australians, for rather better reasons, start almost seven months late.

For an October test, in Israel, it will be the end of Summer Time that
matters.

I would like to know just what the Israeli Summer Time rules really are;
the Knesset should know.

--
© 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 20 '05 #6
> I would like to know just what the Israeli Summer Time rules really are;
the Knesset should know.

the "Winter Clock" started this year on the 3rd of October (hope that
can help).

it is the "YOM KIPUR" holiday - according to Jewish religious it is
time for self examination and forgiveness.

the religious people wake up really early to go to the synagogue,
that's why the "winter clock" starts at that specific date.

So it seems that a religion can effect even your JavaScript code.
Thanks for all your help !!!! ;-)
Jul 20 '05 #7
Dr John Stockton <sp**@merlyn.demon.co.uk> writes:

I would like to know just what the Israeli Summer Time rules really are;
the Knesset should know.


Well, there is an exhaustive list of time zones and assorted rules that
seems to be maintained (oddly enough) by the US National Institutes of
Health (NIH). You can download the gory details from
ftp://elsie.nci.nih.gov/pub/

It does turn out that Israel is a bit (ahem) unusual in that there is no
hard and fast rule. It is set directly for each year, and currently is
only officially available through 2004. Some excerpts from the time
zone data file concerning the Israeli issue. The ftp references in the excerpt
for announcements don't seem to work, even though this is the most
recent file from NIH.

# According to the Office of the Secretary General of the Ministry of
# Interior, there is NO set rule for Daylight-Savings/Standard time changes.
# One thing is entrenched in law, however: that there must be at least 150
# days of daylight savings time annually. From 1993-1998, the change to
# daylight savings time was on a Friday morning from midnight IST to
# 1 a.m IDT; up until 1998, the change back to standard time was on a
# Saturday night from midnight daylight savings time to 11 p.m. standard
# time. 1996 is an exception to this rule where the change back to standard
# time took place on Sunday night instead of Saturday night to avoid
# conflicts with the Jewish New Year. In 1999, the change to
# daylight savings time was still on a Friday morning but from
# 2 a.m. IST to 3 a.m. IDT; furthermore, the change back to standard time
# was also on a Friday morning from 2 a.m. IDT to 1 a.m. IST for
# 1999 only. In the year 2000, the change to daylight savings time was
# similar to 1999, but although the change back will be on a Friday, it
# will take place from 1 a.m. IDT to midnight IST. Starting in 2001, all
# changes to/from will take place at 1 a.m. old time, but now there is no
# rule as to what day of the week it will take place in as the start date
# (except in 2003) is the night after the Passover Seder (i.e. the eve
# of the 16th of Nisan in the lunar Hebrew calendar) and the end date
# (except in 2002) is three nights before Yom Kippur [Day of Atonement]
# (the eve of the 7th of Tishrei in the lunar Hebrew calendar).

# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 1989 only - Apr 30 0:00 1:00 D
Rule Zion 1989 only - Sep 3 0:00 0 S
Rule Zion 1990 only - Mar 25 0:00 1:00 D
Rule Zion 1990 only - Aug 26 0:00 0 S
Rule Zion 1991 only - Mar 24 0:00 1:00 D
Rule Zion 1991 only - Sep 1 0:00 0 S
Rule Zion 1992 only - Mar 29 0:00 1:00 D
Rule Zion 1992 only - Sep 6 0:00 0 S
Rule Zion 1993 only - Apr 2 0:00 1:00 D
Rule Zion 1993 only - Sep 5 0:00 0 S

# The dates for 1994-1995 were obtained from Office of the Spokeswoman for the
# Ministry of Interior, Jerusalem, Israel. The spokeswoman can be reached by
# calling the office directly at 972-2-6701447 or 972-2-6701448.

# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 1994 only - Apr 1 0:00 1:00 D
Rule Zion 1994 only - Aug 28 0:00 0 S
Rule Zion 1995 only - Mar 31 0:00 1:00 D
Rule Zion 1995 only - Sep 3 0:00 0 S

# The dates for 1996 were determined by the Minister of Interior of the
# time, Haim Ramon. The official announcement regarding 1996-1998
# (with the dates for 1997-1998 no longer being relevant) can be viewed at:
#
# ftp://ftp.huji.ac.il/pub/tz/announce...98.ramon.ps.gz
#
# The dates for 1997-1998 were altered by his successor, Rabbi Eli Suissa.
#
# The official announcements for the years 1997-1999 can be viewed at:
#
# ftp://ftp.huji.ac.il/pub/tz/announcements/YYYY.ps.gz
#
# where YYYY is the relevant year.

# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 1996 only - Mar 15 0:00 1:00 D
Rule Zion 1996 only - Sep 16 0:00 0 S
Rule Zion 1997 only - Mar 21 0:00 1:00 D
Rule Zion 1997 only - Sep 14 0:00 0 S
Rule Zion 1998 only - Mar 20 0:00 1:00 D
Rule Zion 1998 only - Sep 6 0:00 0 S
Rule Zion 1999 only - Apr 2 2:00 1:00 D
Rule Zion 1999 only - Sep 3 2:00 0 S

# The Knesset Interior Committee has changed the dates for 2000 for
# the third time in just over a year and have set new dates for the
# years 2001-2004 as well.
#
# The official announcement for the start date of 2000 can be viewed at:
#
# ftp://ftp.huji.ac.il/pub/tz/announce...00-start.ps.gz
#
# The official announcement for the end date of 2000 and the dates
# for the years 2001-2004 can be viewed at:
#
# ftp://ftp.huji.ac.il/pub/tz/announce...000-2004.ps.gz

# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2000 only - Apr 14 2:00 1:00 D
Rule Zion 2000 only - Oct 6 1:00 0 S
Rule Zion 2001 only - Apr 9 1:00 1:00 D
Rule Zion 2001 only - Sep 24 1:00 0 S
Rule Zion 2002 only - Mar 29 1:00 1:00 D
Rule Zion 2002 only - Oct 7 1:00 0 S
Rule Zion 2003 only - Mar 28 1:00 1:00 D
Rule Zion 2003 only - Oct 3 1:00 0 S
Rule Zion 2004 only - Apr 7 1:00 1:00 D
Rule Zion 2004 only - Sep 22 1:00 0 S

# From Paul Eggert (2000-07-25):
# Here are guesses for rules after 2004.
# They are probably wrong, but they are more likely than no DST at all.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2005 max - Apr 1 1:00 1:00 D
Rule Zion 2005 max - Oct 1 1:00 0 S

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Jerusalem 2:20:56 - LMT 1880
2:20:40 - JMT 1918 # Jerusalem Mean Time?
2:00 Zion I%sT

# From Ephraim Silverberg (2003-03-23):
#
# Minister of Interior Poraz has announced that he will respect the law
# passed in July 2000 (proposed at the time jointly by himself and
# then-MK David Azulai [Shas]) fixing the dates for 2000-2004. Hence,
# the dates for 2003 and 2004 remain unchanged....
#
# As far as 2005 and beyond, no dates have been set. However, the
# minister has mentioned that he wishes to propose to move Israel's
# timezone in 2005 from GMT+2 to GMT+3 and upon that have DST during
# the summer months (i.e. GMT+4). However, no legislation in this
# direction is expected until the latter part of 2004 which is a long
# time off in terms of Israeli politics.
--
Thomas A. Russ, USC/Information Sciences Institute
Jul 20 '05 #8
Wow ... what a research!

Well done ;-)
Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Timothy Shih | last post: by
8 posts views Thread by Elliot M. Rodriguez | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.