Working with Dates and Times

We all understand our calendars and datebooks as grids of days, blocks of time that you can add and subtract. You probably do this math all the time: three days from now; a week from tomorrow; a year ago Tuesday; fifteen shopping days until Christmas. This kind of “date math” is crucial to planning projects and coordinating with others. Turns out that Numbers is great at date math, making it easy to, for example, fetch a date that’s a certain number of days (even specifically business days) from another date.

Numbers is particularly good at this because it understands calendars differently than us humans. While we think of a date as a day and a time as a specific moment on the clock, Numbers doesn’t distinguish between the two. A date is a time is a date. When you enter a date into Numbers, you’re entering a time, too; you might not do it explicitly—the time may not even be visible in your spreadsheet—but it’s there. If you don’t enter a time yourself, then Numbers assumes you mean 12:00 a.m. (midnight) on the date you entered. Likewise, when you enter a time, there’s a date attached to it. If you don’t specify the date, then Numbers assumes you mean today. In other words, every date in Numbers is actually a very precise moment in time, right down to the millisecond.

For Numbers, the calendar is just one big rolling conveyor belt, measured in milliseconds. This makes it easy for Numbers to move back and forth in time—whether you want to leap ahead a few ...

Get iWork '09: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.