Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33410
| Newsgroups | comp.lang.javascript |
|---|---|
| Subject | Re: convert dob into days |
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
| References | <d839a415-1bb6-485b-a72d-ca9cd4984b52@googlegroups.com> <XnsA77FC419A70Aeejj99@194.109.6.166> <w_mVA.7579$j%.1051@fx03.iad> |
| Date | 2017-05-25 16:29 +0200 |
| Message-ID | <XnsA780A7AE177F1eejj99@194.109.6.166> (permalink) |
Mark Lloyd <not@mail.invalid> wrote on 24 May 2017 in comp.lang.javascript:
> On 05/24/2017 12:16 PM, Evertjan. wrote:
>> negisunny38@gmail.com wrote on 24 May 2017 in comp.lang.javascript:
>>
>>> Hi
>>>
>>> is this a right way to convert dob into days.
>>>
>>> ========code sample============
>>>
>>> //convert date into days
>>>
>>> function calculate_age(birth_month, birth_day, birth_year) {
>>
>> Don't be so American.
>>
>
> I'm American, and I prefer to put "date parts" in a reasonable order of
> decreasing significance (year, month, day) rather than that mixed-up
> middle-endian format.
Good for you, I bet Trump doesn't. ;-)
> When I write dates for my own use I use that. Today is 2017-5-24.
>
>>> var diffDays = 0;
>>> var oneDay = 24 * 60 * 60 * 1000; //
>>> hours*minutes*seconds*milliseconds var firstDate = new
>>> Date(birth_year, birth_month, birth_day);
>>
>> 1 month wrong!
>
> How do you know the variable isn't right already? Maybe it's already in
> the 0-11 range (0=January, 11=December).
Because people using m-d-y would not understand?
> [snip]
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
convert dob into days negisunny38@gmail.com - 2017-05-24 09:58 -0700
Re: convert dob into days "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-24 19:16 +0200
Re: convert dob into days negisunny38@gmail.com - 2017-05-24 10:31 -0700
Re: convert dob into days "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-24 23:08 +0200
Re: convert dob into days Mark Lloyd <not@mail.invalid> - 2017-05-24 16:33 -0500
Re: convert dob into days "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-25 16:29 +0200
Re: convert dob into days Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-24 20:06 +0200
Re: convert dob into days Mark Lloyd <not@mail.invalid> - 2017-05-24 16:24 -0500
Re: convert dob into days Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-25 01:00 +0200
Re: convert dob into days Mark Lloyd <not@mail.invalid> - 2017-05-24 19:35 -0500
Re: convert dob into days Jon Ribbens <jon+usenet@unequivocal.eu> - 2017-05-25 11:27 +0000
Re: convert dob into days Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-25 13:45 +0200
Re: convert dob into days Mark Lloyd <not@mail.invalid> - 2017-05-25 13:35 -0500
Re: convert dob into days Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-26 00:35 +0200
Re: convert dob into days Dr J R Stockton <J.R.Stockton@physics.org> - 2017-05-25 15:45 -0700
Re: convert dob into days "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-26 09:12 +0200
Re: convert dob into days Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-05-26 18:40 +0100
Re: convert dob into days Sam E <why.should.this@be.email.invalid> - 2017-05-27 10:14 -0500
Re: convert dob into days Dr J R Stockton <J.R.Stockton@physics.org> - 2017-05-24 14:36 -0700
csiph-web