An Excel function that retrieves the date and time

A static value in a worksheet is one that doesn’t change when the worksheet is recalculated or opened. When you press a key combination such as Ctrl+; to insert the current date in a cell, Excel “takes a snapshot” of the current date and then inserts the date in the cell. Because that cell’s value doesn’t change, it’s considered static.

  1. On a worksheet, select the cell into which you want to insert the current date or time.

  2. Do one of the following:

    • To insert the current date, press Ctrl+; (semi-colon).

    • To insert the current time, press Ctrl+Shift+; (semi-colon).

    • To insert the current date and time, press Ctrl+; (semi-colon), then press Space, and then press Ctrl+Shift+; (semi-colon).

To change the date or time format, right-click on a cell, and select Format Cells. Then, on the Format Cells dialog box, in the Number tab, under Category, click Date or Time and in the Type list, select a type, and click OK.

A static value in a worksheet is one that doesn’t change when the worksheet is recalculated or opened. When you press a key combination such as Ctrl+; to insert the current date in a cell, Excel “takes a snapshot” of the current date and then inserts the date in the cell. Because that cell’s value doesn’t change, it’s considered static.

  1. On a worksheet, select the cell into which you want to insert the current date or time.

  2. Do one of the following:

    • To insert the current date, press Ctrl+; (semi-colon).

    • To insert the current time, press

      + ; (semi-colon).

    • To insert the current date and time, press Ctrl+; (semi-colon), then press Space, and then press

      + ; (semi-colon).

To change the date or time format, right-click on a cell, and select Format Cells. Then, on the Format Cells dialog box, in the Number tab, under Category, click Date or Time and in the Type list, select a type, and click OK.

A static value in a worksheet is one that doesn’t change when the worksheet is recalculated or opened. When you press a key combination such as Ctrl+; to insert the current date in a cell, Excel “takes a snapshot” of the current date and then inserts the date in the cell. Because that cell’s value doesn’t change, it’s considered static.

  1. On a worksheet, select the cell into which you want to insert the current date or time.

  2. Do one of the following:

    • To insert the date, type the date (like 2/2), and then click Home > Number Format dropdown (in the Number tab) >Short Date or Long Date.

    • To insert the time, type the time, and then click Home > Number Format dropdown (in the Number tab) >Time.

To change the date or time format, right-click on a cell, and select Number Format. Then, on the Number Format dialog box, under Category, click Date or Time and in the Type list, select a type, and click OK.

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More...Less

This article describes the formula syntax and usage of the NOW function in Microsoft Excel. Find links to more information about working with dates and times in the See Also section.

Returns the serial number of the current date and time. If the cell format was General before the function was entered, Excel changes the cell format so that it matches the date and time format of your regional settings. You can change the date and time format for the cell by using the commands in the Number group of the Home tab on the Ribbon.

The NOW function is useful when you need to display the current date and time on a worksheet or calculate a value based on the current date and time, and have that value updated each time you open the worksheet.

Note: If the NOW function does not update cell values when you expect it to, you might need to change settings that control when the workbook or worksheet recalculates. These settings can be changed in Control Panel for the Excel desktop application.

NOW()

The NOW function syntax has no arguments.

  • Excel stores dates as sequential serial numbers so that they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900.

  • Numbers to the right of the decimal point in the serial number represent the time; numbers to the left represent the date. For example, the serial number 0.5 represents the time 12:00 noon.

  • The results of the NOW function change only when the worksheet is calculated or when a macro that contains the function is run. It is not updated continuously.

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

=NOW()

Returns the current date and time.

11/6/2011 19:03

=NOW()-0.5

Returns the date and time 12 hours ago (-0.5 days ago).

11/6/2011 7:03

=NOW()+7

Returns the date and time 7 days in the future.

11/13/2011 19:03

=NOW()-2.25

Returns the date and time 2 days and 6 hours ago (-2.25 days ago).

11/4/2011 13:03

Year, Month, Day | Date Function | Current Date & Time | Hour, Minute, Second | Time Function

To enter a date in Excel, use the "/" or "-" characters. To enter a time, use the ":" (colon). You can also enter a date and a time in one cell.

Note: Dates are in US Format. Months first, Days second. This type of format depends on your windows regional settings. Learn more about Date and Time formats.

To get the year of a date, use the YEAR function.

Note: use the MONTH and DAY function to get the month and day of a date.

Date Function

1. To add a number of days to a date, use the following simple formula.

2. To add a number of years, months and/or days, use the DATE function.

Note: the DATE function accepts three arguments: year, month and day. Excel knows that 6 + 2 = 8 = August has 31 days and rolls over to the next month (23 August + 9 days = 1 September).

Current Date & Time

To get the current date and time, use the NOW function.

Note: use the TODAY function to enter today's date in Excel.

Hour, Minute, Second

To return the hour, use the HOUR function.

Note: use the MINUTE and SECOND function to return the minute and second.

Time Function

To add a number of hours, minutes and/or seconds, use the TIME function.

Note: Excel adds 2 hours, 10 + 1 = 11 minutes and 70 - 60 = 10 seconds.

Última postagem

Tag