Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Excel date value time zone specific?

Tags:

excel

In Excel, date are stored as an integer value, which is the number of days since Jan 1, 1900. For example, '1/1/1970' is stored as 25569.

Question #1: Unlike Javascript datetime, which references a UTC time (i.e., UNIX epoch time), Excel date definition doesn't mention the timezone of "Jan 1, 1900". Is the reference time 'Jan 1, 1900' not specific to any time zone?

Question #2: I used multiple methods to calculate the days elapsed between 'Jan 1, 1970' and 'Jan 1, 1900', the result is 25567. However, in Excel 'Jan 1, 1970' is stored as 25569 (2 more days than what it should be'. Did I miss something?

like image 554
Coffee Ocean Avatar asked Sep 02 '17 06:09

Coffee Ocean


1 Answers

1: Excel's date/time is in terms of the local time on the computer. It does NOT use the timezone information. To obtain timezone information in Excel requires Windows API calls.

2: Count starts at one (1-Jan-1900 = 1)

    Excel include the non-existent 29-Feb-1900. See: Excel incorrectly assumes that the year 1900 is a leap year

like image 191
Ron Rosenfeld Avatar answered Nov 09 '22 22:11

Ron Rosenfeld