473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Question Concerning Date Function Range

After reading section 15.9.1.1 the ECMAScript Language Specifications I
see that the date range for the Date function is +/- 100,000,000 days
from 01 Jan 1970. This is called an extrapolated Gregorian calendar.
Since the Gregorian calendar did not begin until 15 Oct 1582 what is
the purpose of dates before that date? Wouldn't any computation prior
to that date be meaningless or am I missing something?

The reason I ask is that I have created a date calculator at my web
site. I don't want it to do computations with dates that have no
meaning.

Columbus discovered america on 12 Oct 1492. This must have been with
the Julian Calendar. If I used the Date function to see how many days
it was from that date until now would it be correct?

--
Dennis M. Marks
http://www.dcs-chico.com/~denmarks/
Replace domain.invalid with dcsi.net
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #1
5 2393
JRS: In article <14*************************@domain.invalid>, seen in
news:comp.lang.javascript, Dennis M. Marks <de******@domain.invalid>
posted at Wed, 14 Apr 2004 17:42:43 :
After reading section 15.9.1.1 the ECMAScript Language Specifications I
see that the date range for the Date function is +/- 100,000,000 days
from 01 Jan 1970.
And if you read it more carefully, you will find that it is from
1970-01-01 00:00:00 *UTC*. It is important to remember that the
millisecond count is Greenwich-based.

Since the Gregorian calendar did not begin until 15 Oct 1582 what is
the purpose of dates before that date? Wouldn't any computation prior
to that date be meaningless or am I missing something?
Yes; to the latter. The proleptic Gregorian calendar refers in present
terms to dates before the relevant Julian-Gregorian transition; the
Julian calendar refers to the terms used at the time - though one should
be aware of the difference between O.S. and N.S. dating. It is easier
to calculate with a single, consistent, non-saltatory calendar. The
Julian Calendar is needed only for work dealing with ancient records.

Scaliger chose BC 4713-01-01 noon to start his day-count : on the
proleptic Julian Calendar, of course, as Caesar was at that time minus
four-and-a-half millennia old. Archbishop Ussher of Armagh likewise
calculated the date of the Creation in Julian, likewise proleptic.

All B.C. dates, indeed all dates up to about A.D. 525 and most dates for
a while thereafter, are proleptic. Indeed, it's hard to think of a date
or day scale whose origin is not proleptic.

The reason I ask is that I have created a date calculator at my web
site. I don't want it to do computations with dates that have no
meaning.

Columbus discovered america on 12 Oct 1492.
He did not. He reached an outlying part of the American continents; it
was Friday 1492-10-21 proleptic Gregorian. BTW, Zeller correctly
describes the event as the discovery of the new world, or as a landing;
he does not use the word Amerika (and would not have had a word to use
in the 1883 paper).

This must have been with
the Julian Calendar. If I used the Date function to see how many days
it was from that date until now would it be correct?


One cannot predict what results you might produce; but as-distributed
javascript takes all dates as Gregorian. It was, currently, 186815 days
ago, making due allowance for the calendar change; MJD -133705 (today is
+53110).

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.
Jul 23 '05 #2
In article <V1**************@merlyn.demon.co.uk>, Dr John Stockton
<sp**@merlyn.demon.co.uk> wrote:

<snip>
Columbus discovered america on 12 Oct 1492.


He did not. He reached an outlying part of the American continents; it
was Friday 1492-10-21 proleptic Gregorian. BTW, Zeller correctly
describes the event as the discovery of the new world, or as a landing;
he does not use the word Amerika (and would not have had a word to use
in the 1883 paper).

This must have been with
the Julian Calendar. If I used the Date function to see how many days
it was from that date until now would it be correct?


One cannot predict what results you might produce; but as-distributed
javascript takes all dates as Gregorian. It was, currently, 186815 days
ago, making due allowance for the calendar change; MJD -133705 (today is
+53110).


Thank you for your help.

Since Columbus Day is celebrated on 12 Oct (1492) in the U.S. I just
wondered what calendar this date is based on. Do I assume extrapolated
Gregorian?

Is there a year zero in the Gregorian calendar?

--
Dennis M. Marks
http://www.dcs-chico.com/~denmarks/
Replace domain.invalid with dcsi.net
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #3
In article <15*************************@domain.invalid>, Dennis M.
Marks <de******@domain.invalid> wrote:
In article <V1**************@merlyn.demon.co.uk>, Dr John Stockton
<sp**@merlyn.demon.co.uk> wrote:

<snip>
Columbus discovered america on 12 Oct 1492.


He did not. He reached an outlying part of the American continents; it
was Friday 1492-10-21 proleptic Gregorian. BTW, Zeller correctly
describes the event as the discovery of the new world, or as a landing;
he does not use the word Amerika (and would not have had a word to use
in the 1883 paper).

This must have been with
the Julian Calendar. If I used the Date function to see how many days
it was from that date until now would it be correct?


One cannot predict what results you might produce; but as-distributed
javascript takes all dates as Gregorian. It was, currently, 186815 days
ago, making due allowance for the calendar change; MJD -133705 (today is
+53110).


Thank you for your help.

Since Columbus Day is celebrated on 12 Oct (1492) in the U.S. I just
wondered what calendar this date is based on. Do I assume extrapolated
Gregorian?

Is there a year zero in the Gregorian calendar?


More questions (It never ends, does it?)

I have found out that negative years return a B.C. date that is one
year less. -1 returns 2 B.C.

0-99 returns 1900-1999.

How do I enter the actual years 0-99 (where 0 is actually 1 B.C. and 1
is 1 CE or AD)?

--
Dennis M. Marks
http://www.dcs-chico.com/~denmarks/
Replace domain.invalid with dcsi.net
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 23 '05 #4
JRS: In article <15*************************@domain.invalid>, seen in
news:comp.lang.javascript, Dennis M. Marks <de******@domain.invalid>
posted at Thu, 15 Apr 2004 17:29:17 :

Since Columbus Day is celebrated on 12 Oct (1492) in the U.S. I just
wondered what calendar this date is based on. Do I assume extrapolated
Gregorian?
The date 12 Oct 1492 is a Julian date. Historians almost always use a
current date notation. Zeller, for example, uses it as a Julian example
date in three of his papers (and, if he got it wrong the first time, one
can expect that he would have been corrected in time for the last).

The US thus celebrates, on a day which is not an anniversary, an event
which was not the discovery of America.
Is there a year zero in the Gregorian calendar?


The customary notation has 2 BC, 1 BC, 1 AD, 2 AD - which is in proper
accordance with the meanings of BC & AD.

Astronomer's notation has -2, -1, 0, -1, -2.

Both of those can be used with Julian and Gregorian.

AISB, see below.

--
© 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 #5
JRS: In article <15*************************@domain.invalid>, seen in
news:comp.lang.javascript, Dennis M. Marks <de******@domain.invalid>
posted at Thu, 15 Apr 2004 17:55:15 :
More questions (It never ends, does it?)

I have found out that negative years return a B.C. date that is one
year less. -1 returns 2 B.C.
That is well-known; a year denoted solely by a number smaller than 1 can
only be in astronomical notation.

0-99 returns 1900-1999.
That is because primitive Californian(?) programmers, back in the mists
of time probably before some here were born, did not foresee that there
might be time after the year '99 (even though it had already happened
once in that State).

It would have been far better to implement a primitive new Date which
treated all years straightforwardly, and a new Method to window a date
into a desired 100-year range, absolute or relative to the current year.
How do I enter the actual years 0-99 (where 0 is actually 1 B.C. and 1
is 1 CE or AD)?


If you were to read the FAQ on the subject of dates, you would know how
to find that out; see sig. below.

One way is to add 100 to the year and subtract 1200 from the month.

A better is to use
D = new Date(0) // if needed
D.setHours(0,0,0,0)
D.setFullYear(Y, M-1, D)

However, thought may be needed about what happens, in Spring and in
Autumn, if the seasonal clock change involves Y-M-D 00:00:00, local
time. Anyone from the Azores or East Greenland reading this?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for 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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
8
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them...
4
by: Mark | last post by:
Hi I have been trying to convert the week number to a range of dates that I can use. It should be fairly simple for you guru's out there but for us mere mortals it is beyond our grasp. I know...
1
by: Mike Cooper | last post by:
Hi everyone, This is a tough one. I have a database full of solicitations, identifying a customer and recording initial call, first followup, second followup, etc. My boss want to be able to...
1
by: MLH | last post by:
In an Access 97 form, I have a textbox control with the following code that runs AfterUpdate... Option Compare Database Option Explicit Private Sub UNIXdate_AfterUpdate() Me!RealDate =...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
18
by: dfetrow410 | last post by:
Anyone have some code that will do this? Dave
3
by: Deano | last post by:
The short version; In short, given one date range (start and end dates) how can I find the period that overlaps with another date range? The long version; I have knocked up a little application...
5
by: Robocop | last post by:
Is it possible to do something like this syntactically: year = '2008' month = '09' limit = '31' for i in range(1,limit): temp = Table.objects.filter(date = year'-'month'-'i) <----screwed...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.