Pasting dates in Google Sheets often results in float numbers. For example, dayToDate(42750.5) implies an epoch starting on 1899-12-30. Why opt for this reference?
def dayToDate(day_float):
from datetime import datetime, timedelta
base = datetime(1899, 12, 30)
return base + timedelta(days=day_float)
it seams the 1899 base is just legacy truism from older spreadsheets. keeps old format working and unused formula intact, so no extra hassle when moving data between systems. kinda quirky tho!
The date system used by Google Sheets originates from historical compatibility choices. The initial design was influenced by earlier spreadsheet programs, notably Lotus 1-2-3, which used December 30, 1899 as their base date. I have encountered similar behavior when converting dates in various systems, and it usually revolves around ensuring backward compatibility and consistency across software. The fractional part in date numbers represents time within the day which, though it seems arbitrary at times, enables precision when dealing with both dates and times in calculations.