473,473 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Birthday Calculators -

Hi - can someone help me please?

I would like a countdown script which:

a) is presented as a form to the user
b) form has two date fields (today's date and upcoming event date)
c) results field, in which the difference calculated is displayed.

Results only need to be presented in DAYS format (i.e, don't need to
display hours, minutes, seconds etc..)

The second script I'm after, is a simple
calculation-of-seconds-since-birth script - also in displayed as a form
the user fills in their initial birth date/time details, results
displayed in a "You are ..... seconds old"

Thanking, in advance, anyone who can offer assistance.

Wendy

Oct 15 '05 #1
2 1775
justme wrote:
Hi - can someone help me please?

I would like a countdown script which:

a) is presented as a form to the user
b) form has two date fields (today's date and upcoming event date)
c) results field, in which the difference calculated is displayed.

Results only need to be presented in DAYS format (i.e, don't need to
display hours, minutes, seconds etc..)

The second script I'm after, is a simple
calculation-of-seconds-since-birth script - also in displayed as a form
the user fills in their initial birth date/time details, results
displayed in a "You are ..... seconds old"

Thanking, in advance, anyone who can offer assistance.


The group faq:

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

provides a link that has everything you need for doing date calculations:

<URL:http://www.merlyn.demon.co.uk/js-dates.htm>

--
Rob
Oct 15 '05 #2
JRS: In article <11**********************@g49g2000cwa.googlegroups .com>
, dated Fri, 14 Oct 2005 17:18:19, seen in news:comp.lang.javascript,
justme <00****@gmail.com> posted :
Hi - can someone help me please?

I would like a countdown script which:

a) is presented as a form to the user
b) form has two date fields (today's date and upcoming event date)
c) results field, in which the difference calculated is displayed.

Results only need to be presented in DAYS format (i.e, don't need to
display hours, minutes, seconds etc..)
Use a method based on Zeller's Congruence or similar to convert Y M D to
a DayCount; and subtract. Or use Date Objects, subtract, divide by
864e5, and round to integer. Remember to validate the dates, if it
matters.

The second script I'm after, is a simple
calculation-of-seconds-since-birth script - also in displayed as a form
the user fills in their initial birth date/time details, results
displayed in a "You are ..... seconds old"


Cannot be done reliably. Javascript, like most OSs, has no knowledge of
Summer Time rules other than the current ones; and in most locations the
rules have changed since most people were born, or are about to change.
You'd need to know the moment of birth in UTC.

And they don't know about Leap Seconds either, so even UTC won't give
the right answer unaided.

Hoe many seconds old is a child born in Berlin on 2000-10-29 at 02:30
local time, if it's now whatever time it is at your (unspecified)
location?

--
© 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.
Oct 15 '05 #3

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

Similar topics

51
by: Sandra | last post by:
I was given this problem for extra credit and I am just stuck ! BTW - I am not asking for source code and I am not asking anyone to do my homework as I do want to learn .. I just need a hint or two...
1
by: Claude Alain | last post by:
Hello! We are a small non-profit organisation with about 400 members. We have created a database using Access97 which contains tombstone information on our members, including home adresses and...
2
by: edwin van rutten | last post by:
Hi I have a personal database of all adresses etceteras of personal contacts and want to sort the birthday dates in such a way that I have a chronological list for this years birthdays. The...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
2
by: David Garamond | last post by:
What would be the more proper way of storing birthday data? It will be used to send out birthday messages for customers ("Happy 30th birthday, Sam!"). But the date of birth is not necessarily known...
0
by: Wolf | last post by:
Hi I am using the outlook add in for vs.net 2005 and outlook 2003. I am creating contacts in outlook from our system The clients want to see only the birthdate's and dont want to be bugged...
5
by: NomoreSpam4Me | last post by:
Hi, i did a search and find the way to get the birthday without the year. My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31) and a month field. (1 to 12) My problem is: I...
2
by: Paul H | last post by:
I have a db that stores people and their birth dates. On any given day, I need to know who has a 40th birthday one month from now. I will only be running the query on week days but of course some...
13
kestrel
by: kestrel | last post by:
Sheila and He-Man are twins; Sheila is the OLDER twin. Assume they were born immediately after each other, an infinitesimally small - but nonzero - amount of time apart. During one year in the...
1
by: stilldancin12 | last post by:
Ok so i have to write an application that asks for the users birthday and replies with they day of the week in which he or she is born on, using the java program. This is what I have so far.It gives...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.