Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Inserting the Current Time with Seconds.

Inserting the Current Time with Seconds

by Allen Wyatt
(last updated May 15, 2019)


As you have learned in other ExcelTips, you can use Ctrl+: (that's a colon) to enter the current time into a cell. The resulting cell value is equal to the hours and minutes of the current time. In other words, the seconds will always be zero.

If you want to insert the current time and have it include the seconds, the best way is to use a macro. You can then assign the macro to a keyboard shortcut or a toolbar button (or both) so it can be immediately popped into place. The following macro will do the trick nicely:

Sub TimeStamp()
    ActiveCell.Value = Time
    ActiveCell.NumberFormat = "h:mm:ss AM/PM"
End Sub

Notice that the time is placed in the cell and then the cell is formatted to show hours, minutes, and seconds.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10635) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Inserting the Current Time with Seconds.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Inserting Special Spaces

Do you need to frequently add en spaces and em spaces to your documents? You can add special tools to Word that make ...

Discover More

Formatting Text Files with VBA

Got a bunch of text that you've imported from a text file? Need to make it look better? You can take a stab at it with ...

Discover More

Creating a List of Files in a Directory

Do you need a list of all the files in a directory? It's easy to create if you use the proper command-line commands.

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Stopping a Checked Box from being Unchecked

When creating user forms for use in Excel, you are provided with a range of controls you can add, including check boxes. ...

Discover More

Getting Rid of Alphabetic Characters

When you need to get rid of characters in the middle of a cell value, the best way to do it is through the use of macros. ...

Discover More

Generating Unique Numbers for Worksheets

You may need to automatically generate unique numbers when you create new worksheets in a workbook. Here are a couple of ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 1?

2019-08-24 06:49:20



2017-08-19 06:18:08

Willy Vanhaelen

Perhaps the macro solution in this tip is what you are looking for:

If so see also my comment of 2016-02-21 there.

2017-08-18 11:45:52


I am creating a spreadsheet for co-workers to use that have little or no excel experience. In order to make it easy for them I am trying to insert the current date and time in a cell to record when an action occurred. That date and time must remain and not change.

I have been able to insert a calendar to select a date. I cannot find a way to insert the actual time that will remain static. I also cannot find a 'clock' that actually keeps current time. What I've inserted is a time that doesn't change.

It seems like I need VBA code to do this. Any thoughts.

2017-05-24 17:26:08



2017-03-08 19:29:40


Thank you

2017-02-18 12:19:16

Peter Atherton


Unless you prefer the 24 hour clock and use "[h]:mm:ss"

2017-02-17 14:40:14


Brilliant! This is just what I needed for my project! Thank you!

2016-12-10 05:45:35

Rick Rothstein

I am confused. When I run the macro without that NumberFormat line of code, the time still goes into the cell correctly, with the seconds, and the cell's format is changed to Custom "h:mm:ss AM/PM" automatically. I do not see why you thought you needed to manually format the cell via the macro. If it makes a difference, I am using XL2010 on Win 8.1.

2015-03-30 14:49:12


HAHA exactly what I was looking for. A lot of other sites either gave the NOW() or Ctr + : tips but those were useless for a person who needed the seconds. Very easy and now I get to say I made a macro. (Fist pump)

2015-01-09 09:06:57

Mike O\'Neill

Hi. I posted this tip on the Excel 2007 page, now repeating it here: If you do not want to use macros, or are unable to, then a simple but less elegant option is to enter the formula
in the formula bar, then immediately press f9 <Enter> to fix the value. Make sure that the cells in the column or cell are formatted to show the time in seconds.

It is a short formula so not too much work. But if you need to do it multiple times you could first copy the =NOW() into the copy buffer, then use the following sequence of keystrokes to paste into the formula bar as follows:
<F2> <Paste> <F9> <Enter>

(Where <Paste> is Ctrl-V or equivalent)

2014-10-26 09:51:26


Michael (Micky) Avidan:

You are quite right. I misread the hint.

2014-10-26 06:57:59

Michael (Micky) Avidan

The tip says very clearly:
you can use Ctrl+: (that's a colon) to enter the current time into a cell. The resulting cell value is equal to the hours and minutes of the current time. In other words, the seconds will always be zero.
Watch, carefully, the last 9 words.
Any "Date/Time" worksheet function is Volatile - and as such will be re-calculate upon every sheet recalculation.
The only way to insert and PRESERVE(!) the current Date/Time is with VBA Code.
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)

2014-10-25 19:32:28

Peter Atherton

The trouble with Ctrl+: is that it is formatted to the nearest minute. The macro inserts the time value so will not recalculate. Also by assigning a Keyboard shortcut of say Ctrl+T it is no harder to enter than the Excel Function

2014-10-25 14:25:25


The macro is not strictly necessary.

If you use the "=NOW()" formula or the "Ctrl+:" shortcut in a cell or column already formatted to show seconds, that is exactly what it will do.

(1) When you put the current time into a cell by any of these methods, there is a good chance that by the time it is displayed in the cell the seconds will no longer be right.
(2) How do you ensure that cells holding the current time formula do not recalculate whenever the worksheet is itself recalculated?

If that is not what you want, you must use the "Ctrl+:" shortcut

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.