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

Written by Allen Wyatt (last updated May 1, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

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 add it to the Quick Access Toolbar (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, 2013, 2016, 2019, and Excel in Microsoft 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. ...

MORE FROM ALLEN

Paragraph Formatting Shortcuts

Paragraphs are one of the elemental building blocks in a Word document. Formatting those paragraphs is easy to do if you ...

Discover More

What is the Perfume Hoax?

Perfume can be alluring, but it can also be used for nefarious purposes—or so the perfume hoax proposes. Understand ...

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

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)

Creating a String in a Macro

Need to put together a bunch of characters to create a text string? You can do it in your macros by using the String ...

Discover More

Displaying the Selected Cell's Address

Need to know the address of the cell that is currently selected? The function and macro highlighted in this tip will come ...

Discover More

Opening a Workbook and Suppressing Automatic Macros

Want to stop Excel from running any automatic macros that may be stored with a workbook? Here's how to do it.

Discover More
Subscribe

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

View most recent newsletter.

Comments

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}] (all 7 characters, in the sequence shown) 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 + 8?

2021-05-01 16:24:20

J. Conklin

If you want to insert the current time with seconds but without a macro, do the following:

1) set the cell to have the following custom format: dd-mmm-yyyy hh:mm:ss

I use "military" or "European" date format since that's the one used when I'm working on genealogy. If you prefer U.S. date format, set the custom format to mmm-dd-yyyy

2) in that cell, enter =NOW()


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
Subscribe

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.