简体   繁体   中英

Is Excel date value time zone specific?

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 (ie, 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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM