Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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.

Note:

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, and 2013. 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. ...

##### MORE FROM ALLEN

Saving Custom Formats

While the implementation of custom formats in Excel is not terribly robust, you can still achieve some amazing results ...

Discover More

Converting to ASCII Text

When you work with imported or pasted data in an Excel worksheet, you may see some strange looking characters at times. ...

Discover More

Vertical Alignment of Sections

Using one of the page setup options in Word, you can specify that the paragraphs within the section be vertically aligned ...

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)

Calculating the Distance between the Top of the Window and Row 1

Normally Excel positions a UserForm in the center of your screen. You may want to position the form elsewhere, more ...

Discover More

Putting an X in a Clicked Cell

Need to click on a cell and have it replaced with an "X"? Macros make it easy to do, as illustrated in this tip.

Discover More

Recovering Macros from Corrupted Workbooks

Workbooks get corrupted from time to time; that's a fact of life in an Excel world. If those corrupted workbooks contain ...

Discover More
##### Subscribe

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

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 two more than 9?

2019-08-24 06:49:20

RAMANAND

I WANT TO ADD DATA IN CELL A(SCANNING) AND I WANT TIME IN CELL B, I WANT TO SEE THE TIME TO SCAN

2017-08-19 06:18:08

Willy Vanhaelen

@Walt
Perhaps the macro solution in this tip is what you are looking for:
https://excelribbon.tips.net/T013233_Automatically_Entering_a_Data_Entry_Time.html

2017-08-18 11:45:52

Walt

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

Great

2017-03-08 19:29:40

HARINATH KOTLA

Thank you

2017-02-18 12:19:16

Peter Atherton

Rick

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

2017-02-17 14:40:14

Lisa

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

Jake

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
=NOW()
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

BHershman

Michael (Micky) Avidan:

You are quite right. I misread the hint.

2014-10-26 06:57:59

Michael (Micky) Avidan

@BHershman,
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)
ISRAEL

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

BHershman

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.

Incidentally:
(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.

##### Subscribe

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