Sub topic 1
How Sheets stores dates and times
Every date and time in Google Sheets is a number. The date functions in the later chapters all work on that number, so this chapter covers how the number is built and how to read it.
Prerequisites
This chapter assumes you can:
- Enter values and formulas in cells.
- Use relative and absolute cell references.
- Apply a number format from the Format menu.
You don't need to know any date functions yet. The few used here are introduced as they appear.
The serial number model
Sheets stores a date as a count of days. This count is called a serial number. Day 0 is 1899-12-30, and each later day adds 1.
| Date | Serial number |
|---|---|
| 1899-12-29 | -1 |
| 1899-12-30 | 0 |
| 1899-12-31 | 1 |
| 1970-01-01 | 25569 |
| 2026-01-01 | 46023 |
| 2026-11-28 | 46354 |
Dates before 1899-12-30 are negative numbers. Sheets handles them without trouble.
You can check any row of this table. Enter the formula below in a cell, then set the cell to Format > Number > Number:
=DATE(2026, 11, 28)The cell shows 46354. Set the format back to Format > Number > Date and it shows 2026-11-28 again (the exact pattern depends on your locale). The value in the cell never changed. Only the way it is drawn on screen changed.
Day 0 differs from Excel
Excel for Windows counts day 1 as 1900-01-01 and wrongly treats 1900 as a leap year. Sheets uses 1899-12-30 as day 0 so that serials after 1900-03-01 match Excel. Serials for dates in 1900 before that differ by one. Modern dates are unaffected. Be careful only if you handle dates before March 1900.
Times are fractions of a day
A time of day is stored as the fractional part of a day. Midnight is 0. Noon is 0.5. Each hour is 1/24 of a day.
| Time of day | Fraction |
|---|---|
| 00:00:00 | 0 |
| 06:00:00 | 0.25 |
| 12:00:00 | 0.5 |
| 18:00:00 | 0.75 |
| 23:59:59 | about 0.99999 |
A date-time adds the two parts. The value 46354.75 means day 46354 plus three quarters of a day, which is 2026-11-28 at 18:00.
This gives three useful rules:
- The integer part is the date.
=INT(A2)removes the time. - The fractional part is the time of day.
=MOD(A2, 1)keeps only the time. - One second is 1/86400 of a day, because a day has 86,400 seconds.
=INT(NOW())=MOD(NOW(), 1)The first formula returns today's date at midnight. The second returns the current time as a fraction. Format the first as a date and the second as a time to read them.
Formats change the display, not the value
The number format of a cell decides how its number is shown. It does not decide what the number is. One stored value can look like any of these:
| Format | Display of 46354.75 |
|---|---|
| Number | 46354.75 |
| Date | 2026-11-28 |
| Time | 18:00:00 |
| Date time | 2026-11-28 18:00:00 |
| Custom `dddd, mmmm d` | Saturday, November 28 |
| Plain text | 46354.75 |
Three things follow from this.
- Changing the format never changes a calculation. A formula that reads the cell gets the number.
- A formula result can show as a plain number when you expected a date. Sheets often picks a date format for you when a formula returns a date, but not always. If you see a number like
46354, apply a date format. - Custom formats let you show a weekday name or a month name while the cell still holds a number that sorts and compares correctly.
To set a custom pattern, use Format > Number > Custom date and time. Common pieces are yyyy for the year, mm for the month, dd for the day, hh for the hour, and mm for minutes when it follows an hour. Sheets works out from the position whether mm means month or minute.
Check what a cell really holds
Don't judge by appearance. Test the content instead:
=ISNUMBER(A2)This returns TRUE for a real date or time and FALSE for text that only looks like one. A quick visual hint is alignment. Numbers, including real dates, align right by default. Text aligns left. This is only a hint, because alignment can be overridden.
To see the underlying number, use:
=VALUE(A2)If A2 is a real date, this returns its serial number. If A2 is text that Sheets can read as a date, it converts it. If it can't, you get a #VALUE! error.
Why this design is useful
Dates stored as numbers make most date work ordinary arithmetic:
- Later dates have bigger numbers, so sorting and
>or<comparisons work. - Subtracting two dates gives the days between them.
- Adding 7 to a date gives the date one week later.
=A2 + 7=B2 - A2The first formula gives the date seven days after A2. The second gives the number of days from A2 to B2. If the result shows as a date such as 1900-01-14, the cell has a date format. Change it to Number, because the result is a count of days and not a date. Later chapters cover this in detail.
Edge cases and limits
Floating-point precision
Times are stored as fractions, and many fractions can't be held exactly in binary. Two values that look identical can differ by a tiny amount. Compare times with rounding instead of with =:
=ROUND(A2 - B2, 8) = 0For whole days this is rarely a problem. It matters mainly when you add many small fractions or compare computed times.
The time zone is part of the spreadsheet
The serial number has no time zone. It is just a count. However, functions like NOW() and TODAY() must turn the real current moment into a count, and for that they use the time zone set in File > Settings. Two spreadsheets with different time zone settings can show different values for TODAY() near midnight. Locale and time zone settings get their own chapter.
Locale changes what you type, not what is stored
The locale setting controls how Sheets reads typed text such as 3/4/2026. In one locale that is March 4. In another it is April 3. Once Sheets accepts the entry as a date, it stores a serial number, and the locale only affects display. For this reason a date built from numbers is safer than a typed one:
=DATE(2026, 11, 28)This builds the value from year, month and day numbers and does not depend on how text is parsed.
Text that looks like a date
If Sheets does not recognise an entry as a date, it keeps it as text. Typical causes are a date pasted from another system, extra spaces, or an unusual pattern. The cell then looks right but fails in formulas. Test it with ISNUMBER, and see the chapter on converting text and dates for fixes.
Durations are numbers too
A duration such as 36 hours is just 1.5 days. A cell with a Time format can wrap around and show 12:00:00 for it. A Duration format (Format > Number > Duration) shows 36:00:00 instead. The stored value is 1.5 either way.
A worked check
Do this in a blank sheet to confirm the model.
- In
A1enter=DATE(2026, 11, 28) + 0.75. - In
B1enter=INT(A1). - In
C1enter=MOD(A1, 1). - Format
A1as Date time,B1as Date,C1as Time. - Copy
A1:C1toA2:C2, then set all three cells in row 2 to Format > Number > Number.
Row 1 shows 2026-11-28 18:00:00, 2026-11-28 and 18:00:00. Row 2 shows 46354.75, 46354 and 0.75. Both rows hold the same numbers. Only the display differs.
Summary
- Dates are whole-number day counts, with 1899-12-30 as day 0.
- Times are fractions of a day. A date-time is the sum of both.
- Number formats change only the display.
- Use
ISNUMBERandVALUEto find out what a cell really holds. - Build dates with
DATEinstead of typing text, to avoid locale effects.
Exercise
Cell A1 contains the value 46354.25 and is formatted as Number. What date and time does it represent, and which two formulas split it into its date part and its time part?
Show answer
The whole part 46354 is 2026-11-28, and the fraction 0.25 is a quarter of a day, which is 06:00:00. So the value is 2026-11-28 06:00:00. The date part is =INT(A1), which returns 46354. The time part is =MOD(A1, 1), which returns 0.25.
Exercise
A colleague types 2026-11-28 into a cell, and it is left-aligned. A formula =A2 + 7 returns #VALUE!. What is likely wrong, which formula confirms it, and what would it return?
Show answer
Sheets did not recognise the entry as a date, so the cell holds text. =ISNUMBER(A2) confirms it by returning FALSE. A real date would return TRUE.
Exercise
You enter =DATE(2026, 11, 28) in B2 and see 46354 instead of a date. Is the formula wrong? How do you fix the display?
Show answer
The formula is correct. The cell has a Number format, so the serial number is shown. Apply Format > Number > Date to display it as 2026-11-28. The stored value stays 46354.