OLE Automation Date Conversion: What It Changes and When to Rely on It

How OLE Automation dates work, what converting them changes, how they relate to Excel serial dates, and when a plain readable date is the safer output.

An OLE Automation date is a number that stands for a calendar date and time of day. Converting one, either from the number to a readable date or from a date back to the number, is a common task in spreadsheets, legacy Windows software, COM interop and data exports. This review covers what the conversion changes, where it can quietly go wrong, and when a plain readable date is the better output. No specific converter tool was tested for this article. The behavior described here comes from the published definition of the format, and the worked values can be checked by hand from that definition.

What an OLE Automation date is

The format stores a date as a double-precision floating-point number:
• The whole-number part counts days from the base date, midnight on December 30, 1899.
• The fractional part is the time of day as a fraction of 24 hours, so 0.25 is 6:00 AM, 0.5 is noon and 0.75 is 6:00 PM.
Values before the base date are negative, and they follow an unusual rule. The whole-number part counts days backward, but the fractional part still counts forward from midnight. So -1.25 means 6:00 AM on December 29, 1899, not 6:00 PM on December 28.

OLE value | Date and time it represents
0 | 1899-12-30 00:00
1 | 1899-12-31 00:00
1.25 | 1899-12-31 06:00
2 | 1900-01-01 00:00
-1.25 | 1899-12-29 06:00
25569 | 1970-01-01 00:00
36526 | 2000-01-01 00:00
45658.5 | 2025-01-01 12:00

What the conversion actually changes

This is not a visual effect. Text tools that reverse, mirror or restyle characters change how text looks. An OLE date conversion changes the data itself. Two operations are often confused:

  • Changing the display format. A spreadsheet cell can hold the number 45658.5 and show it as a date. The stored number stays the same, and arithmetic, sorting and formulas keep working.
  • Converting the value. Turning the number into a text string such as "2025-01-01 12:00" replaces a sortable number with characters. Going the other way turns a string into a number that only means something to software that knows the 1899 base date.

Before converting, decide which of these you need. If the date only has to look readable inside a spreadsheet or application, changing the cell or field format is usually enough and preserves the original value. A true conversion is needed when the data leaves that environment, for example in a CSV for another system, a report or a database column.

How it relates to Excel serial dates

Excel's default 1900 date system stores dates as serial numbers that match OLE Automation values from March 1, 1900 onward. Before that date they differ by one day. Excel treats 1900 as a leap year, which it was not, and keeps a nonexistent February 29, 1900 as serial 60. For January 1 through February 28, 1900, an Excel serial is one less than the OLE value for the same date.
Excel workbooks can also use the 1904 date system, which numbers days from January 1, 1904. A serial taken from such a workbook is 1,462 lower than the OLE value for the same date. If a converter's result is off by about four years, a 1904-based source is the likely cause.

Worked conversions

In .NET, DateTime.FromOADate and DateTime.ToOADate implement the format directly, including the rule for negative values. A hand-rolled version that just adds days to December 30, 1899 matches only for non-negative values:

// C#
DateTime d = DateTime.FromOADate(45658.5);   // 2025-01-01 12:00:00
double oa  = new DateTime(2000, 1, 1).ToOADate(); // 36526

# Python: matches OLE semantics only for values >= 0
from datetime import datetime, timedelta
base = datetime(1899, 12, 30)
base + timedelta(days=45658.5)   # 2025-01-01 12:00:00
base + timedelta(days=-1.25)     # 1899-12-28 18:00, but OLE means 1899-12-29 06:00

Because 1970-01-01 is OLE value 25569, you can convert to Unix seconds with (value − 25569) × 86400. That formula only holds if you choose to treat the OLE value as UTC. The format itself does not say which time zone it uses.

Pitfalls that change meaning

  • No time zone. The number records a wall-clock date and time with no offset. In .NET, FromOADate returns a DateTime whose Kind is Unspecified. If the source system's time zone is unknown, the converted time may be off by hours, and around daylight-saving changes it can be ambiguous.
  • Negative values. Arithmetic across the 1899 base date does not work as you would expect. Values between -1 and 1 can even describe the same moment: -0.5 and 0.5 both mean noon on December 30, 1899. Do not compute durations directly on values that may be negative.
  • Sub-second precision. The time is a binary floating-point fraction, so seconds and milliseconds may not round-trip exactly. Many implementations round to milliseconds. If exact timestamps matter, compare results after rounding to the precision you need.
  • Range. .NET accepts OLE values covering roughly the years 100 through 9999. Other implementations may allow a different range or reject negative values.
  • Zero and blanks. A value of 0 often means "no date" rather than December 30, 1899. Check how the source system marks missing dates before converting.

Will the result stay readable and usable after copying or sharing?

Raw OLE values do not hold up well outside software that expects them. Pasted into a document, an email or a general-purpose field, 45658.5 is just a number. Search will not match it to a date, a person editing it cannot easily tell what it means, and a screen reader will announce it as a number rather than a date. If people will read the value, share a readable date alongside it or instead of it.

Readable dates have problems of their own once copied. A string like 01/02/2025 means January 2 in US convention and February 1 in many other regions. Spreadsheets and import tools often reinterpret pasted date strings according to the locale of the receiving machine, so the same text can become a different stored date there. ISO 8601 (2025-01-02, or 2025-01-02T12:00 with a time) avoids the day/month ambiguity and sorts correctly as plain text. Add a UTC offset only if you actually know the source time zone.

Behavior in a specific spreadsheet, database or assistive technology was not tested for this article. If your workflow depends on one, try a few known values in that exact environment, such as 36526 and a date before March 1, 1900. Do not assume one successful paste will behave the same everywhere.

Is converting suitable for your use?

Keep or produce OLE Automation values when the destination expects them: COM and Office automation, legacy Windows applications, or a spreadsheet that will keep doing date arithmetic. The main benefit is that a single sortable number carries both date and time, and the receiving software understands it without parsing.
The main tradeoff is that the number has no time zone and no self-description. Its meaning depends on everyone agreeing on the 1899 base date, the Excel date system and the source's local time.
Convert to a plain readable date, ideally ISO 8601, when people will read the data, when it is shared across regions or systems, when it needs to be searchable, or when the dates may fall before March 1900. If you need both, keep the original number in one column and the readable date in another, so the conversion can be checked and reversed.

Checking a converter before trusting it

  • Test known values: 0 should give 1899-12-30, 36526 should give 2000-01-01, and 45658.5 should give 2025-01-01 at noon.
  • Test a negative value: -1.25 should give 1899-12-29 06:00.
  • Find out whether it reads input as an OLE value, an Excel 1900 serial or an Excel 1904 serial, and whether it accounts for the February 1900 discrepancy.
  • Check whether the output format states the order of day, month and year, and whether it adds or assumes a time zone.
  • Do not assume an online converter keeps your data private just because it looks simple or says so in its marketing. If the dates are sensitive, convert them locally with code like the example above.

Gaps in this review

No specific converter, spreadsheet version, browser or screen reader was tested, so this article makes no claims about how any named product renders or handles converted dates. The example values follow from the format's definition and can be checked by hand. The .NET range and negative-value behavior come from that platform's documented semantics and may differ in other libraries.