Shortcut to Enter GMT

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


2

When Farol uses the shortcut Ctrl+Shift+; Excel enters the local time in the cell. He wonders if there is any way to have it, instead, enter GMT (+7 or +8 hours) into the cell.

There is no way to configure Excel to do this, but it is a very easy task to create a macro that will enter the adjusted time. If you know that your local time is 8 hours behind GMT, then you can use a macro such as the following:

Sub EnterGMT()
    ActiveCell = Time + (8 / 24)
End Sub

You can then assign the macro to a shortcut key and use it to enter the time in any cell. If your local time is actually 7 hours behind GMT, then simply change the 8 to a 7 in the formula.

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 (13084) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Deleting a Final Blank Page

When creating a document, if can be frustrating to have a blank page somehow appear at the end of the document. If you ...

Discover More

Using Custom Add-Ins

Once you've created your custom add-in, you need to know how you or other people can use it. Here are the simple steps to ...

Discover More

Filling Table Cells with a Macro

Want to stuff a value into each cell of a table? You can either type the value over and over and over again, or you can ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Calculating Elapsed Time with Excluded Periods

When using Excel to calculate elapsed time, there can be all sorts of criteria that affect the formulas you would ...

Discover More

Dealing with Small Time Values

It is no secret that you can store time values in an Excel worksheet. But do you really know how small of a time value ...

Discover More

Dealing with Midnight Ending a Day

Dealing with times in Excel is fairly straightforward, except when it comes to midnight. Some people prefer that midnight ...

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 8 - 5?

2021-09-04 16:03:19

Mike

A more general solution, which would appear to work in any time zone, at any time of the year, can be found here.

https://stackoverflow.com/questions/1600875/how-to-get-the-current-datetime-in-utc-from-an-excel-vba-macro/23968601

The code is written as a UDF but to run it as a sub, the code in the tip could then be:

Sub EnterGMT()
ActiveCell = Format(UtcTime(Time), "hh:mm")
End Sub


2021-09-04 11:04:33

Tomek

You have to remember to change this macro when there is a change from summer to standard time. Is there a function that can tell whether the current time is standard or daylight savings time?


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.