Today we'll discuss what you can do with dates and time in a Google spreadsheet. Let's take a closer look at how you can enter date and time into your table, and how to format and convert them to numbers.
How to insert date and time in Google Sheets
Let's start by entering the date and time into a Google Sheets cell.
Tip. Date and time formats depend on the default locale of your spreadsheet. To change it, go to File > Settings. You'll see a pop-up window where you can set your region under the General tab > Locale. Thus, you'll ensure those date and time formats you're accustomed to.
There are three ways to insert date and time into your Google spreadsheet:
Add date and time manually
Note. No matter how you want the time look like at the end, you should always enter it with a colon. This is essential for Google Sheets to distinguish between time and numbers.
It may seem to be the easiest way but locale settings that I mentioned above play a vital role here. Every country has its own pattern for displaying date and time.
As you all know, the American date format differs from the European one. If you set "United States" as your locale and type in the date in the European format: dd/mm/yyyy, it simply won't work. The entered date will be treated as a textual value. So, pay attention to that.
Tip. You can add today's date much quicker. Type @ in the required cells and continue with the word today:
Google Sheets will recognize your prompt and suggest you add Today's date. Click it, and your text will turn into today's date:
Confirm by pressing Enter.
Make Google Sheets auto-populate your column with date or time
Fill in a few cells with the required date/time/date time values.
Select these cells so you could see a small circle at the bottom right corner of the selection:
Click that circle and drag the selection down, covering all required cells.
You'll see how Google Sheets automatically populates those cells based on two samples you provided, retaining the intervals:
Use key combinations to insert current date and time
Place the cursor into the cell of interest and press one of the following shortcuts:
- Ctrl+; (semicolon) to enter the current date.
- Ctrl+Shift+; (semicolon) to enter the current time.
- Ctrl+Alt+Shift+; (semicolon) to add both, current date and time.
Later you'll be able to edit the values. This method helps you bypass the problem of entering an incorrect date format.
Take advantage of Google Sheets date and time functions
TODAY() — returns the current date to a cell.
NOW() — returns the current date and time to a cell.
Note. These formulas will be recalculated, and the result will be renewed with every change made in the table.
Here you are: you've placed date and time to our cells. The next step is to format the information to display it the way you need it.
As it is with numbers, you can make your spreadsheet return date and time in various formats.
Place the cursor into the needed cell and go to Format > Number. You can choose between four different default formats or create a custom one using Custom date and time setting:
As a result, one and the same date looks different with various formats applied:
As you can see, depending on your needs, there are a few ways to set the date format. It allows displaying any date and time value, from a day to a millisecond.
Make your date/time a part of Data validation.
In case you need to use date or time in Data validation, proceed to Data > Data validation in the Google Sheets menu first:
- As for dates, just set them as criteria and choose the option that suits you best:
- As for time units, since they are absent from these settings by default, you will need to either create an additional column with time units and refer to this column with your Data validation criteria (List from a range), or enter time units directly to the criteria field (List of items) separating them by a comma:
Insert time to Google Sheets in a custom number format
Suppose you need to add time in minutes and seconds: 12 minutes, 50 seconds. Place the cursor to A2, type 12:50 and press Enter on your keyboard.
Note. No matter how you want the time to look like at the end, you should always enter it with a colon. This is essential for Google Sheets to distinguish between time and numbers.
What you'll see is Google Sheets treating your value as 12 hours 50 minutes. If you apply the Duration format to A2, it'll still show the time as 12:50:00.
So how can you make Google spreadsheet return only minutes and seconds?
- Type 00:12:50 to your cell.
To be honest, this one may turn out a tiresome process if you need to enter multiple timestamps with minutes and seconds only.
- Type 12:50 to A2 cell and put the following formula into A3:
=A2/60
Then apply the Duration number format to A3. Otherwise, your table will always return 12 hours AM. - Use special formulas.
Input minutes to A1, seconds — to B1. Enter the following formula to C1:
=TIME(0,A2,B2)
In order to delete excess symbols from our time, set the format again. Go to Custom date and time and create a format that will show only elapsed minutes and seconds:
The TIME function refers to cells, takes the values and transforms them into hours (0), minutes (A1), and seconds (B1).
Convert time to decimal in Google Sheets
Let's move on to various operations you can do with date and time in Google Sheets.
There may be cases when you need to display time as a decimal rather than "hh:mm:ss" to perform various calculations. Why? For example, to count per-hour salary, since you can't perform any arithmetic operations using both, numbers and time.
But the problem disappears if time is decimal.
Let's say column A contains the time you started working on some task and column B shows the end time. You want to know how much time it took, and for that, in column C you use the formula below:
=B2-A2
Copy the formula down cells C3:C5 and get the result in hours and minutes. Then transfer the values to column D using this formula:
=$C2
Then select entire column D and go to Format > Number > Number:
Unfortunately, the result you'll get at first won't say much. But Google Sheets has a reason for that: it displays time as a part of a 24-hour period. In other words, 50 minutes is 0.034722 of 24 hours.
Of course, this result can be used in calculations.
But since we're used to seeing time in hours, you may want to introduce more calculations to your table. To be specific, multiply the number you've got by 24 (24 hours):
Now you have a decimal value, where integer and fractional reflect the number of hours. To put it simply, 50 minutes is 0.8333 hours, while 1 hour 30 minutes is 1.5 hours.
Text-formatted dates to date format with Power Tools for Google Sheets
There's one quick solution for converting dates formatted as text to a date format. It's called Power Tools. Power Tools is an add-on for Google Sheets that allows you to convert your information in a couple of clicks:
- Install Power Tools to your Google Sheets by clicking the button below.
- Go to Extensions > Power Tools > Start to run the add-on and click the Convert tool icon on the add-on pane. Alternatively, you can pick the Tools > Convert tool right from the Power Tools menu.
- Select the range of cells that contain dates formatted as text.
- Check the box for the option Convert text to dates and click Run:
Your text-formatted dates will be formatted as dates in just a few seconds.
I hope you've learned something new today. If you have any questions left, feel free to ask them in the comments below.
Next time you'll learn how to calculate the time difference and sum dates and time together.
by
Latest comments
I need to enter time into a cell to record break times?is there a way just to enter the current time.
Paste the formula in the cell:
=NOW()
Format the cell as Time (Format → Number → Time).
to get it static, use:
Ctrl + Shift + ; (Windows)
Cmd + Shift + ; (Mac)
That inserts the current time as a fixed value.
I want to store automatically date & time when data entered in sheets how can i do
Hello SPARTAN,
The functions mentioned here should help you.
This time only changes if you made changes to something but you can enter =NOW()
Can Google enter full dates (IE 2024-06-18) if I only enter the day and month, IE 18/6 for the 18th of June in the current year? Excel and OpenOffice both allow this. I'm wondering if Google Sheets does too. If so, how do I access this function, as at the moment, it's not doing so. BTW, I am in Australia, so 2024-06-18 instead of 2024-18-06.
Hello Dominic,
Yes, it can. First, you need to format cells as dates. Then enter 18/06 into these cells and they will appear in the required format.
i want day by day automatically date changing formula in google sheet
Hello vignesh,
Try the TODAY() function mentioned in this part of the article.
Hello,
I opened a csv file with google sheets and there are a lot of dates like this one 9/29/2022, 10:04:04 PM (mm/dd/yyyy hh:mm:ss am/pm). This csv file i have to import it in a program wich read the dates dd/mm/yyyy hh:mm:ss am/pm and at dates like this 9/29/2022, 10:04:04 PM it show error "invalid date" . Is possible to change 9/29/2022 in 29/09/2022 without doing this manually (too many dates to change manually) ?
Hello Lenovo,
Try changing the locale in the file uploaded to Google Sheets first.
If this doesn't help, try applying the new custom format to all dates at once by these instructions.
Yet all these are still manual. To do this automatically, you'd have to use Google Apps Script.
Hello Natalia,
I am trying to create a formula where "IF Date is "Today" Then, "Due Today" type of statement.
Additionally, "If Date is "Past Due" Then,"Assignment Overdue" ...
Not sure exactly how to put this together or if it is possible.
Im actually looking to insert this into a "Monday.com" formula box but this should also be universal with the formula structures in Google.
Thanks in advance.
Hi! To get a value by condition, use these guidelines: Google Sheets IF function – usage and formula examples. If I understand your task correctly, try the following formula:
=if(A1=today(), "Today",if(A1<today(),"Assignment Overdue",""))
I am trying to validate a complete date in google sheets, and have been using the "isDate()" function. However, it validates true even if the date is just a month/year although all the documentation I've seen says that it requires a month/day/year. Is there a way to validate that a cell and require the month, day and year? It seems that it just defaults to the first day of the month.
Ex: Cell A1 contains "10/1929"
=isDate(A1) returns true
=Day(A1) returns 1
Hello Mitch,
Google Sheets picks up dates written in different formats. Hence, you're right, it treats 10/1929 as October 1st, 1929. You'll see the same in the formula bar if you select the cell. I'm afraid this is a matter of the format visible to you which cannot be handled with formulas.
However, you can try some kind of a workaround. For example, use the IF function to check if the Day from A1 equals 1. And if so, mark the date as potentially incomplete.
how to insert drop down date and time in one chell
Hello Padmanaban,
Please check out this article: How to add, edit and delete drop-down lists in Google Sheets
I have a sheet with contacts from different time zones within the US. How can I show the time zone of each contact? is there a way to convert time to different time zone so I can have a single time for every contact?
Hello Nasir Khan,
I'm afraid there are no standard functions to work with the time zones. You will have to add formulas that add the required amount of hours to show the same time zone for each contact.
Alternatively, you can use scripts. You may try to find the solution here – an overview of Google Apps Script with a lot of helpful content and links: https://developers.google.com/apps-script/overview
I am using google sheet and applying formula =IF(L2="Fully Consumed",TODAY(),""), it means that if condition is fulfilled in L2 Column i.e. "Fully Consumed" then Current Date should be in N2 columns, it is applying properly but Date is changed on daily basis as current date which should not be done, I want that date should be applied once then should not be changed as date changed. Is there any proper solution of my problem?
Hello Khawaja Arshad,
TODAY is a volatile function meaning it recalculates itself in all cells once anything at all is edited in your spreadsheet. Since there are no other standard formulas for this task, I can advise you to either replace dates with values at the end of the day or use scripts. You may try to find the solution here – an overview of Google Apps Script with a lot of helpful content and links: https://developers.google.com/apps-script/overview
I am creating a spreadsheet for my online classmates.
We are all over the world, and I am wondering if there is a way to have a cell show what time it is in each person's locale (updating itself every minute to the current time). Can I tell the cell to show current Eastern Standard time in one cell, and current Swedish time in another cell?
Hello kargelc,
If you're in Eastern Standard Time, set this time zone in your spreadsheet settings first. Then =NOW() will show your current time.
Swedish is located 5 hours away from EST. So use =NOW() + 5/24 to show Swedish time in another cell.
hi im new to google sheets, i have a lessons time table that has Period 1 through 5 along the top and the staff members down the side. i have entered the correct formula to have it colour coded so when a staff member puts in their data for eg; "Period 3" it automatically gives their cell the same colour assigned to that staff member etc.
As each period passes throughout the day i manually highlight the vertical row (eg Period 1) and colour it out grey to show its unavailable to enter request in. My question is; is there a way to assign a time stamp to each assigned cells or rows so when that time has passed it automatically colours out the appropriate cells? so this would happen when I'm not able to get to my laptop.
Hi Holli,
If there are some indicators of those periods in your table (time in cells), you can try to create conditional formatting rules based on those. Otherwise, you'd have to use Google Apps Script.
Hi!
I would like to know if there is a formula that will retrieve the current date after new entry data on a row. I noticed that =TODAY() will change previous dates to the current one. Please advise and thank you!
Hi Carlos,
I'm afraid TODAY is a volatile function. It recalculates itself in all cells each time anything is edited on the sheet. There are a few workarounds I can offer:
I enter into Google Sheets a day and a month 15/12 and it automatically enters it in as 15/12/2022
As I am entering projected dates we are starting to enter dates for Jan but it puts a 2022, is there any way when i type 15/1 it will add 2023 for a future date rather than automatically do 2022
Hello Brett,
Simply apply a custom date format to all cells that should look like 15/1.
Hi! This is very helpful! Thanks! I'm new to GSheets. I wonder if you could help me with this. So my Google Forms response populates in a google sheet file. Every time I get a new response, the date and time gets recorded in Column A. I want to copy ONLY the DATES in column A to another column (say, column N). But I want the date to be automatically copied to column N every time a new response is recorded. So I don't have to manually do it. How can I do that? Does anyone know how? Many thanks!
Hi!
Thank you for your nice feedback :)
You will find ways to extract date unit or time unit from a date time cell in this blog post.
However, please keep in mind that new answers from forms are always added as new rows to your Google spreadsheet (rather than to existing empty rows). This is the way form responses are collected. So if you choose formulas to get the date units, you will have to copy them to new rows manually. If you chose the add-on, you will have to run it for all newly added rows as well.
=IF(C9"",NOW(),1) Once the date time is updated with this formula, what should be done so that the time is not updated again?
Hello Umesh,
NOW() is a volatile function meaning it recalculates itself in all cells once anything at all is edited in your spreadsheet. Since there are no other standard formulas for this task, I can only advise you to use scripts. You may try to find the solution here – an overview of Google Apps Script with a lot of helpful content and links:
https://developers.google.com/apps-script/overview
Hi,
Is there a way for me to measure the time elapsed between two different dates. I have a date of 13/03/2021, and I have a cell that has the current date. I want a code that measures the difference between these two dates. Is this possible?
Thanks,
Joel
Hi Joel,
Yes, just subtract your date from the current one and format the resulting cell as Number or Duration depending on how you want to see the result. You will find more info about it in this blog post.
Hi,
I'm new to sheets. I'm wondering how I change the time to fifteen minute increments?
Hi Katie,
You need to change the time format. The first two points of the blog post above will tell you how to do that.
Hello
I want to enter medical data into a spreadsheet such as Temperature & Blood pressure and have the Date and Time data auto fill. I tried this formula but it kept changing the date and time info when I made the next entry. =if(A2="","",today()) I don't want the date or time to ever change as long as data is present in A2.
Thanks
Hello,
You see, such functions as TODAY and NOW are volatile: they recalculate themselves in all cells each time anything is edited in the sheet. There are 2 workarounds I can offer:
I'm trying to input a time value in a minutes:seconds format. However, it automatically changes it to hours:minutes:seconds.milliseconds. Is there any way to circumvent this?
Hello Gus,
Looks like your cells are formatted this way. Please try to change the format of your column by following the steps described in the blog post.