Sub topic 3
Creating dates and times with DATE, TIME, TODAY and NOW
This chapter assumes you can enter formulas, use relative and absolute cell references, and apply number formats from the Format menu. It also assumes you know that Sheets stores a date as a number (days since 1899-12-30) and that a format only changes how that number looks. Here you will build date and time values from parts, and you will get the current date and time.
Why build dates from numbers
You can type 2026-11-28 into a cell and Sheets will usually turn it into a date. That parsing depends on the spreadsheet's locale. The same text can be read as 11 December in one locale and as a failed parse in another. A formula that builds a date from separate numbers does not depend on any of that.
The four functions in this chapter cover most needs:
| Function | Returns | Arguments |
|---|---|---|
| `DATE` | A date at midnight | year, month, day |
| `TIME` | A fraction of a day | hour, minute, second |
| `TODAY` | The current date | none |
| `NOW` | The current date and time | none |
DATE: year, month, day
DATE(year, month, day) returns a real date value. The cell is usually formatted as a date automatically.
=DATE(2026, 11, 28)This displays 11/28/2026 or 28/11/2026, depending on locale. The stored number is the same in both cases. You can check it by changing the cell's format to Number, which shows 46354.
Each argument can be a number, a cell reference or a calculation. That makes DATE the standard way to rebuild a date after you change one part of it:
=DATE(YEAR(A2), MONTH(A2), 1)This returns the first day of the month of the date in A2. The YEAR and MONTH functions are covered in the next chapter. Here you only need to see that the output of one function can feed the arguments of DATE.
Values that overflow
DATE does not reject a month above 12 or a day above the length of the month. It rolls the extra into the next unit. This is the behavior that makes date calculations short.
| Formula | Result | Why |
|---|---|---|
| `=DATE(2026, 13, 1)` | 2027-01-01 | Month 13 is January of the next year |
| `=DATE(2026, 12, 32)` | 2027-01-01 | Day 32 of December is 1 January |
| `=DATE(2026, 3, 0)` | 2026-02-28 | Day 0 is the day before day 1 |
| `=DATE(2026, 0, 1)` | 2025-12-01 | Month 0 is December of the previous year |
| `=DATE(2026, 1, -5)` | 2025-12-26 | Negative days count back from the last day of the previous month |
Day 0 gives a quick way to find the last day of a month. DATE(2026, 3, 0) is the last day of February because it counts back one day from 1 March. To get the end of the month of a date in A2, use =DATE(YEAR(A2), MONTH(A2) + 1, 0). Chapter-level alternatives such as EOMONTH are covered later in this tutorial.
=DATE(2026, 1, 31) + 30Adding to a date works too, because the date is a number of days. This returns 2026-03-02.
Two-digit and out-of-range years
A year between 0 and 1899 is treated as an offset from 1900. =DATE(26, 1, 1) does not return a date in 26 AD. It returns 1 January 1926. Always pass a four-digit year.
=DATE(26, 1, 1)The result is 1926-01-01. If you read years from text or from an import, check that they have four digits before you pass them in.
Non-integer and text arguments
Decimal arguments are truncated, not rounded. =DATE(2026, 11.9, 28.9) is treated as DATE(2026, 11, 28). A text argument that looks like a number, such as "11", is usually converted. A text argument that does not, such as "Nov", causes a #VALUE! error.
TIME: hour, minute, second
TIME(hour, minute, second) returns a fraction of a day between 0 and just under 1. Noon is 0.5, because it is half of 24 hours.
=TIME(14, 30, 0)Formatted as a time, this displays 2:30:00 PM. Formatted as a number, it shows 0.6041666667, which is 14.5 divided by 24.
TIME does not return an error for large values, but it wraps around. It keeps only the part of the result that is within one day.
| Formula | Result | Why |
|---|---|---|
| `=TIME(25, 0, 0)` | 1:00:00 AM | 25 hours wraps to 1 hour |
| `=TIME(0, 90, 0)` | 1:30:00 AM | 90 minutes is 1 hour 30 minutes |
| `=TIME(0, 0, 3600)` | 1:00:00 AM | 3600 seconds is 1 hour |
| `=TIME(-1, 0, 0)` | 11:00:00 PM | Negative values wrap backward |
The wrap is a trap when you want a duration. If you need 36 hours as a duration, TIME(36, 0, 0) gives 12:00:00, not 36 hours. Use =36/24 and format the cell as a duration instead. Durations are covered in a later chapter.
Combining a date and a time
A date-time is a date number plus a time fraction. Add the two results:
=DATE(2026, 11, 28) + TIME(9, 15, 0)The cell must be formatted as Date time to show both parts. If it shows only a date, the time is still stored. You can see this by switching the format to Number, which shows 46354.385416667 (a whole number of days plus a fraction).
TODAY and NOW
TODAY() returns the current date. NOW() returns the current date and time. Both take no arguments, but you must still type the parentheses.
=TODAY()
=NOW()On 2026-11-28 at 00:14, TODAY() returns 2026-11-28, which is the whole number 46354. NOW() returns 2026-11-28 00:14:40 and the stored value is 46354.0102 (approximately).
The two differ in one important way: TODAY() is always a whole number, so its time part is zero. NOW() includes the time. This matters for comparisons.
=A2 = TODAY()If A2 holds a date at midnight, this returns TRUE on that day. If A2 holds a date-time from NOW(), it returns FALSE, because the fraction never matches. To compare only the date parts, use INT:
=INT(A2) = TODAY()INT drops the fraction and leaves the whole day number.
Time zones
TODAY() and NOW() use the time zone set under File > Settings > General, not the time zone of your computer. If a team shares a spreadsheet and the setting is Los Angeles, TODAY() changes at midnight in Los Angeles for everyone. Check this setting first when TODAY() seems to be a day off.
They change by themselves
TODAY() and NOW() are volatile. Sheets recalculates them when the spreadsheet is opened and when it changes. Under File > Settings > Calculation you can set recalculation to "On change" or "On change and every minute" or "On change and every hour". Without the periodic option, a sheet that stays open does not update NOW() until something else triggers a recalculation.
Two consequences follow:
- A formula that uses
TODAY()gives a different answer tomorrow. This is what you want for "days until the deadline" and what you do not want for "date this row was entered". - Neither function records a moment. To stamp a fixed date, type it with Ctrl+; (date) or Ctrl+Shift+; (time), or use a script. A formula cannot freeze its own value.
Using TODAY in a calculation
Subtracting two dates gives a number of days, so TODAY() works well in countdowns:
=B2 - TODAY()If B2 holds a due date, the result is the days remaining. It is negative once the date has passed. Format this cell as Number, because Sheets may copy the date format from B2 and show the result as a date in 1899 or 1900.
A worked example
A project sheet has a start year, month and day in separate columns, and a start time in a fourth.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Year | Month | Day | Hour | Starts |
| 2 | 2026 | 12 | 1 | 9 |
In E2, build the start date-time:
=DATE(A2, B2, C2) + TIME(D2, 0, 0)Format E2 as Date time. The result is 2026-12-01 09:00:00. To show how long remains before the start, use this in F2:
=E2 - NOW()Format F2 as Number. On 2026-11-28 at 00:14 the value is about 3.37, which means three days and about nine hours. Multiplying by 24 would give hours, a technique covered with durations.
Common errors
- A number such as 46354 appears instead of a date. The value is correct but the cell is formatted as a number. Apply Format > Number > Date.
- A date shows as 12/30/1899. The result is 0 or a small number of days, often from an empty cell used in
DATEor from a subtraction formatted as a date. Fix the inputs or format the result as Number. #VALUE!fromDATE. An argument is text that cannot be converted, such as a month name. Convert it to a number first.- The year is 19xx. The year argument was below 1900. Use four digits.
TODAY()shows yesterday or tomorrow. The spreadsheet time zone differs from your own. Change it under File > Settings.TIMEshows the wrong hour for large values. It wraps at 24 hours. Use division by 24 for durations.
Exercise
Cell A2 contains the year 2026 and cell B2 contains the month number 2. Write one formula that returns the last day of that month, and say what it returns. Then write a formula that returns 6:45 PM on that day.
Show answer
Use day 0 of the following month: =DATE(A2, B2 + 1, 0). For 2026 and month 2 this returns 2026-02-28. For 6:45 PM on that day, add a time: =DATE(A2, B2 + 1, 0) + TIME(18, 45, 0), formatted as Date time, which returns 2026-02-28 18:45:00.
Exercise
A cell contains =NOW() and another contains =TODAY(). Why does =A1 = B1 return FALSE even though both show the same date, and how do you fix it?
Show answer
NOW() includes a time fraction and TODAY() is a whole number, so the two values never match exactly. Compare only the whole-day part with =INT(A1) = B1.