DATE2JULIAN Function (Gnumeric)
Convert a Gnumeric Gregorian date into an integer Julian day number, with noon-convention, date-system and near-midnight cautions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =DATE2JULIAN(DATE(2000,1,1)) has the independent reference result 2451545. This is an integer day number for a Gregorian date, not a continuously increasing timestamp with a time fraction.
Availability and evidence
- Introduction: Gnumeric 1.10.8. Its release notes name DATE2JULIAN among the new date-conversion functions.
- Source support: Registered in the Gnumeric 1.12.62 plugin. No retirement is established. The last functioning application version is unverified for this guide.
- Evidence dates: Gnumeric 1.12.62 source was retained October 13–14, 2026 and reviewed October 15. Historical introduction evidence, GOffice 0.10.61 source and the calendar reference were retrieved October 15 where cited. Independent calendar or exact-rational calculations are labeled reference results; no native Gnumeric, headless application or GUI execution was performed.
Syntax and calendar meaning
=DATE2JULIAN([date])
The one date argument is optional. With a supplied worksheet date, the function obtains Gregorian year, month and day using the workbook’s date conventions, then passes those components to its Julian-day algorithm. With the argument omitted, the helper uses the system’s current date. For a reproducible worksheet, supply an explicit date rather than relying on the clock.
Despite its location in the Hebrew Date Functions plugin, DATE2JULIAN takes a Gregorian date. It does not take a Hebrew-calendar date, convert to the Julian calendar, or return a day-of-year code such as 2026001.
The U.S. Naval Observatory’s conversion reference explains the noon-based Julian-date convention and the same integer algorithm family used here. The integer 2451545 corresponds to noon on January 1, 2000 in that convention; continuous astronomical JD at the start of that date is 2451544.5. DATE2JULIAN identifies the calendar date and does not encode the time of an astronomical observation.
Reproducible date-to-day-number sheet
Create JulianDates with Date and Day_number in A1:B1. Enter =DATE(2000,1,1), =DATE(2001,3,30), =DATE(2024,2,28), =DATE(2024,2,29) and =DATE(2024,3,1) in A2:A6. Put =DATE2JULIAN(A2) in B2 and fill down. The reference integers are 2451545,2451999,2460369,2460370,2460371.
Display B as an ordinary integer rather than applying a spreadsheet date format to it. Its origin is different from the workbook’s date-serial origin. In particular, a raw serial copied between 1900 and 1904 workbooks can change its represented civil date; reconstruct the date with DATE or an explicitly verified import instead of assuming serial numbers are interchangeable.
Reference cases
| Formula | Independent reference result |
|---|---|
=DATE2JULIAN(DATE(1970,1,1)) |
2440588 |
=DATE2JULIAN(DATE(2000,1,1)) |
2451545 |
=DATE2JULIAN(DATE(2001,3,30)) |
2451999 |
=DATE2JULIAN(DATE(2024,2,28)) |
2460369 |
=DATE2JULIAN(DATE(2024,2,29)) |
2460370 |
=DATE2JULIAN(DATE(2024,3,1)) |
2460371 |
=DATE2JULIAN(DATE(2026,1,1)) |
2461042 |
=DATE2JULIAN(DATE(2026,2,1)) |
2461073 |
=DATE2JULIAN(DATE(2026,10,15)) |
2461329 |
=DATE2JULIAN(DATE(2026,1,1)+0.5) |
2461042 |
These results were cross-checked using the source integer algorithm, an independently arranged Gregorian algorithm and calendar ordinals. A midday time fraction on January 1 does not add 0.5 to this function’s result: the output remains the integer associated with that date.
Advanced: compare spans without mixing origins
Put =DATE(2026,1,1) in D2 and =DATE(2026,2,1) in D3. In E2 and E3 convert those dates with DATE2JULIAN. The expected integers are 2461042 and 2461073. Both =E3-E2 and =D3-D2 represent 31 days for this modern pair. Do not subtract a Julian day number directly from a worksheet date serial: their origins differ, even though both advance by one per day over this range.
A leap-year control uses February 28 to March 1, 2024: the day-number difference is 2. Changing the year to 2023 gives 1. These checks catch a missing February 29 without relying on a localized date display. For the same explicit valid date, HDATE_JULIAN(year,month,day) calls the same underlying integer converter and provides a source-backed cross-check.
Day extraction and near-midnight rounding
The date helper does more than naïvely discard every fraction. The checked GOffice 0.10.61 serial-to-day conversion applies floor(raw_serial+0.5/86400), a half-second allowance. Thus a value extremely close to the end of a day can be treated as the next date. Ordinary midnight and midday controls are well away from this boundary.
If an input is an observation timestamp and sub-second timing matters, do not assume DATE2JULIAN preserves that information. Keep the timestamp separately, define its time scale and timezone, and use an appropriate explicitly specified continuous-JD conversion. This guide does not claim native behavior at an exact floating-point half-second tie.
Defaults, errors and troubleshooting
The omitted-date form =DATE2JULIAN() uses a clock-dependent civil date. The registration is volatile; no live clock, timezone or recalculation-timing test was run. Invalid supplied dates that fail the shared date conversion return #NUM! at this callback. Text coercion, historical calendar limits, negative serial settings and the fictitious 1900 leap day are outside the worked modern dates.
Use four-digit years inside DATE. If the result appears as an unexpected year or a huge timestamp, inspect the number format and whether the value was mistakenly interpreted as a workbook serial. The algorithm’s Gregorian day count does not establish a historical jurisdiction’s calendar-adoption rule. No import/export preservation or native plugin activation workflow is certified.
Sources and related guides
- Function-specific help and worksheet callback
- Gnumeric date-serial conversion and annual denominator
- Gregorian-to-Julian integer algorithm and current-date/default helpers
- Official GOffice 0.10.61 source archive, goffice/utils/datetime.c lines 146–150, for serial-day extraction. This is source evidence, not a compiled-library test.
- Gnumeric official function catalogue