473,386 Members | 1,706 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,386 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 2395
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.