Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32003
| From | Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: What is wrong with this If Else construction? |
| Date | 2016-12-27 22:52 +0000 |
| Organization | Home |
| Message-ID | <sM+SWgK3CvYYFwu7@invalid.uk.co.demon.merlyn.invalid> (permalink) |
| References | <47744619-426f-4af1-8376-e2935a2570db@googlegroups.com> |
In comp.lang.javascript message <47744619-426f-4af1-8376-e2935a2570db@go
oglegroups.com>, Mon, 26 Dec 2016 00:05:46, bart.smissaert@gmail.com
posted:
>New to JavaScript and trying to calculate the date of birth from an
>Excel date, provided as an integer value (1 Jan 1900 = 1).
Your inability is profound.
Firstly, correct the Excel date (by +1 or -1, to allow for the idiot
Californians not understanding the Gregorian calendar) as necessary;
call that CXLD.
Then consider
CXLD = 42345
new Date(Date.UTC(1900, 0, CXLD))
which shows __me__
Tue Dec 08 2015 00:00:00 GMT+0000 (GMT Standard Time)
The Date.UTC(...) eliminates concern about possible effects of Time Zone
and Summer Time.
In JavaScript, always use UTC within calendar-type calculations; use
local date/time, *where*needed*, for I/O.
--
(c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME.
Merlyn Web Site < > - FAQish topics, acronyms, & links.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What is wrong with this If Else construction? bart.smissaert@gmail.com - 2016-12-26 00:05 -0800
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-26 10:37 +0100
Re: What is wrong with this If Else construction? bart.smissaert@gmail.com - 2016-12-26 03:45 -0800
Re: What is wrong with this If Else construction? Luuk <luuk@invalid.lan> - 2016-12-26 12:59 +0100
Re: What is wrong with this If Else construction? bart.smissaert@gmail.com - 2016-12-26 04:02 -0800
Re: What is wrong with this If Else construction? bart.smissaert@gmail.com - 2016-12-26 04:16 -0800
Re: What is wrong with this If Else construction? me <mu@local.local> - 2016-12-26 13:34 +0100
Re: What is wrong with this If Else construction? Bart Smissaert <bart.smissaert@gmail.com> - 2016-12-26 05:02 -0800
Re: What is wrong with this If Else construction? Luuk <luuk@invalid.lan> - 2016-12-26 18:32 +0100
Re: What is wrong with this If Else construction? Bart Smissaert <bart.smissaert@gmail.com> - 2016-12-26 15:32 -0800
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-27 10:05 +0100
Re: What is wrong with this If Else construction? Bart Smissaert <bart.smissaert@gmail.com> - 2016-12-27 03:27 -0800
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-27 21:46 +0100
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-29 18:36 +0100
Re: What is wrong with this If Else construction? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-12-28 23:16 +0000
Re: What is wrong with this If Else construction? Luuk <luuk@invalid.lan> - 2016-12-27 22:28 +0100
Re: What is wrong with this If Else construction? Gene Wirchenko <genew@telus.net> - 2016-12-27 15:07 -0800
Re: What is wrong with this If Else construction? Luuk <luuk@invalid.lan> - 2016-12-28 19:37 +0100
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-26 21:56 +0100
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-26 22:14 +0100
Re: What is wrong with this If Else construction? Gene Wirchenko <genew@telus.net> - 2016-12-26 14:12 -0800
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-27 00:02 +0100
Re: What is wrong with this If Else construction? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-12-27 22:36 +0000
Re: What is wrong with this If Else construction? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-12-28 10:36 +0100
Re: What is wrong with this If Else construction? Luuk <luuk@invalid.lan> - 2016-12-26 17:00 +0100
OT: Leap year bug in Excel (was: What is wrong with this If Else construction?) "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-12-26 17:12 +0100
Re: What is wrong with this If Else construction? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-12-27 22:52 +0000
Re: What is wrong with this If Else construction? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-12-28 01:01 +0100
Re: What is wrong with this If Else construction? $Bill <news@todbe.com> - 2016-12-27 22:19 -0800
Re: What is wrong with this If Else construction? Tim Streater <timstreater@greenbee.net> - 2016-12-28 10:05 +0000
Re: What is wrong with this If Else construction? [OT] $Bill <news@todbe.com> - 2016-12-28 13:59 -0800
Re: What is wrong with this If Else construction? [OT] Tim Streater <timstreater@greenbee.net> - 2016-12-28 22:17 +0000
csiph-web