Automatically show time in different time zones.

DPChristman

Board Regular
Joined
Sep 4, 2012
Messages
178
Office Version
  1. 365
Platform
  1. Windows
I do a lot of work coast to coast, and much of it involves reviewing CCTV footage.

I am looking for a formula that can pull up the local time in another time zone (maybe by zip code).

Is there an easy formula for this that doesn't involve complicated macros.

I can always just do a Google search when I need to look one up, but I am trying to find a simpler was of accomplishing this in a list of locations.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Assuming you are in the States, possibly something like the below (yellow highlighted cell is the time entry cell based on UTC, Column B is the State to look up), please note I am in the UK so might be off the mark on what you are looking for here.

Book1
ABCDEFGHIJ
1UTC timeStateResultState / federal district or territoryTime OffsetsPlus or minusDSTDetails
209:00Arkansas03:00:00Alabama06:00-1CTYesCentral Standard Time(Phenix Cityobserves Eastern time on ade factobasis)
3Alaska109:00-1AKTYesMost of state:UTC−09:00AKSTAlaska Standard Time
4Alaska210:00-1HTAleutian Islands(west of 169°30' W):UTC−10:00HSTHawaii–Aleutian Standard Time
5American Samoa11:00-1STNoSamoa Standard Time
6Arizona07:00-1MTPartMountain Standard Time. Except for theNavajo Nation, Arizona does not observe DST.
7Arkansas06:00-1CTYesCentral
8California08:00-1PTYesPacific Standard Time
9Colorado07:00-1MTYesMountain
10Connecticut05:00-1ETYesEastern Standard Time
11Delaware05:00-1ETYesEastern
12District of Columbia05:00-1ETYesEastern
13Florida105:00-1ETYesBig Bendand peninsula regions east of theApalachicola Riveralong with the portion ofGulf Countysouth of theIntracoastal Waterway:UTC−05:00ESTEastern Standard Time
14Florida206:00-1CTYesFlorida PanhandleWest of the Apalachicola River except for the portion of Gulf County south of the Intracoastal Waterway:UTC−06:00CSTCentral Standard Time
15Georgia05:00-1ETYesEastern
16Guam10:001ChTNoChamorro Standard Time
17Hawaii10:00-1HTNoHawaii–Aleutian
18Idaho107:00-1MTYesMost of state:UTC−07:00MSTMountain Standard Time (A legislative error in 1923 in theCalder Actseemingly put this area atUTC−06:00CST, and was corrected by Congress in 2007.[1])15 U.S.C.ch. 6, § 264. MST has been observed since 1923.
19Idaho208:00-1PTYesNorth of the Salmon River, that is between the Oregon state border and the Idaho County/Lemhi County border; west of the Idaho County/Lemhi County border, that is between the Salmon River and the Montana state border:UTC−08:00PSTPacific Standard Time
20Illinois06:00-1CTYesCentral
21Indiana105:00-1ETYesMost of state:UTC−05:00ESTEastern Standard Time
22Indiana206:00-1CTYesNorthwest and southwest corners:UTC−06:00CSTCentral Standard Time (SeeTime in Indianafor more information)
23Iowa06:00-1CTYesCentral
24Kansas106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
25Kansas207:00-1MTYesGreeley,Hamilton,ShermanandWallacecounties:UTC−07:00MSTMountain Standard Time
26Kentucky105:00-1ETYesEastern 60% of state:UTC−05:00ESTEastern Standard Time
27Kentucky206:00-1CTWestern 40% of state:UTC−06:00CSTCentral Standard Time
28Louisiana06:00-1CTYesCentral
29Maine05:00-1ETYesEastern
30Maryland05:00-1ETYesEastern
31Massachusetts05:00-1ETYesEastern
32Michigan105:00-1ETYesMost of state:UTC−05:00ESTEastern Standard Time
33Michigan206:00-1CTYesUpper Peninsula counties borderingWisconsin:UTC−06:00CSTCentral Standard Time
34Minnesota06:00-1CTYesCentral
35Mississippi06:00-1CTYesCentral
36Missouri06:00-1CTYesCentral
37Montana07:00-1MTYesMountain
38Nebraska106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
39Nebraska207:00-1MTYesNebraska Panhandle, counties withColoradoas a western boundary, and the westernSand Hills:UTC−07:00MSTMountain Standard Time
40Nevada107:00-1MTYesWest Wendovercity limits:UTC−07:00MSTMountain Standard Time
41Nevada208:00-1PTYesMost of state:UTC−08:00PSTPacific Standard Time
42New Hampshire05:00-1ETYesEastern
43New Jersey05:00-1ETYesEastern
44New Mexico07:00-1MTYesMountain
45New York05:00-1ETYesEastern
46North Carolina05:00-1ETYesEastern
47North Dakota106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
48North Dakota207:00-1MTYesWest of theMissouri River(exceptMortonandOlivercounties, and parts ofDunn,McKenzie, andSiouxcounties:UTC−07:00MSTMountain Standard Time
49Northern MarianaIslands10:001ChTNoChamorro
50Ohio05:00-1ETYesEastern
51Oklahoma06:00-1CTYesCentral (Kentonobserves Mountain time on ade factobasis)
52Oregon107:00-1MTYesNorthern 80% ofMalheur County:UTC−07:00MSTMountain Standard Time
53Oregon208:00-1PTYesMost of state:UTC−08:00PSTPacific Standard Time
54Pennsylvania05:00-1ETYesEastern
55Puerto Rico04:00-1ATNoAtlantic Standard Time
56Rhode Island05:00-1ETYesEastern
57South Carolina05:00-1ETYesEastern
58South Dakota106:00-1CTYesEastern half of state:UTC−06:00CSTCentral Standard Time
59South Dakota207:00-1MTYesWestern half of state:UTC−07:00MSTMountain Standard Time
60Tennessee105:00-1ETYesEast Tennessee, exceptBledsoe,Cumberland, andMarionCounties:UTC−05:00ESTEastern Standard Time
61Tennessee206:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
62Texas106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
63Texas207:00-1MTYesEl PasoandHudspethcounties:UTC−07:00MSTMountain Standard Time
64U.S. Minor Outlying Islands10.51NoWake Island:UTC+12:00(Wake Island Time Zone)
65U.S. Minor Outlying Islands20.5-1NoBaker IslandandHowland Island:UTC−12:00
66U.S. Minor Outlying Islands311:00-1STNoJarvis Island,Kingman Reef,Midway Atoll, andPalmyra Atoll:UTC−11:00(Samoa Time)
67U.S. Minor Outlying Islands410:00-1HTNoJohnston Atoll:UTC−10:00(Hawaii–Aleutian Time)
68U.S. Minor Outlying Islands505:00-1ETNo
69Utah07:00-1MTYesMountain
70Vermont05:00-1ETYesEastern
71Virgin Islands (U.S.)04:00-1ATNoAtlantic
72Virginia05:00-1ETYesEastern
73Washington08:00-1PTYesPacific
74West Virginia05:00-1ETYesEastern
75Wisconsin06:00-1CTYesCentral
76Wyoming07:00-1MTYesMountain
Sheet4
Cell Formulas
RangeFormula
C2C2=A2+XLOOKUP(B2,E2:E76,F2:F76)*XLOOKUP(B2,E2:E76,G2:G76)
 
Upvote 0
Or with a starting state

Book1
ABCDEFGHIJKL
1Entry timeEntry StateUTC timeDestination StateResultState / federal district or territoryTime OffsetsPlus or minusDSTDetails
209:00Alaska118:00Alabama12:00Alabama06:00-1CTYesCentral Standard Time(Phenix Cityobserves Eastern time on ade factobasis)
310:00Alaska220:00Alabama14:00Alaska109:00-1AKTYesMost of state:UTC−09:00AKSTAlaska Standard Time
411:00Florida116:00Alabama10:00Alaska210:00-1HTAleutian Islands(west of 169°30' W):UTC−10:00HSTHawaii–Aleutian Standard Time
512:00Alabama18:00Alabama12:00American Samoa11:00-1STNoSamoa Standard Time
6Arizona07:00-1MTPartMountain Standard Time. Except for theNavajo Nation, Arizona does not observe DST.
7Arkansas06:00-1CTYesCentral
8California08:00-1PTYesPacific Standard Time
9Colorado07:00-1MTYesMountain
10Connecticut05:00-1ETYesEastern Standard Time
11Delaware05:00-1ETYesEastern
12District of Columbia05:00-1ETYesEastern
13Florida105:00-1ETYesBig Bendand peninsula regions east of theApalachicola Riveralong with the portion ofGulf Countysouth of theIntracoastal Waterway:UTC−05:00ESTEastern Standard Time
14Florida206:00-1CTYesFlorida PanhandleWest of the Apalachicola River except for the portion of Gulf County south of the Intracoastal Waterway:UTC−06:00CSTCentral Standard Time
15Georgia05:00-1ETYesEastern
16Guam10:001ChTNoChamorro Standard Time
17Hawaii10:00-1HTNoHawaii–Aleutian
18Idaho107:00-1MTYesMost of state:UTC−07:00MSTMountain Standard Time (A legislative error in 1923 in theCalder Actseemingly put this area atUTC−06:00CST, and was corrected by Congress in 2007.[1])15 U.S.C.ch. 6, § 264. MST has been observed since 1923.
19Idaho208:00-1PTYesNorth of the Salmon River, that is between the Oregon state border and the Idaho County/Lemhi County border; west of the Idaho County/Lemhi County border, that is between the Salmon River and the Montana state border:UTC−08:00PSTPacific Standard Time
20Illinois06:00-1CTYesCentral
21Indiana105:00-1ETYesMost of state:UTC−05:00ESTEastern Standard Time
22Indiana206:00-1CTYesNorthwest and southwest corners:UTC−06:00CSTCentral Standard Time (SeeTime in Indianafor more information)
23Iowa06:00-1CTYesCentral
24Kansas106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
25Kansas207:00-1MTYesGreeley,Hamilton,ShermanandWallacecounties:UTC−07:00MSTMountain Standard Time
26Kentucky105:00-1ETYesEastern 60% of state:UTC−05:00ESTEastern Standard Time
27Kentucky206:00-1CTWestern 40% of state:UTC−06:00CSTCentral Standard Time
28Louisiana06:00-1CTYesCentral
29Maine05:00-1ETYesEastern
30Maryland05:00-1ETYesEastern
31Massachusetts05:00-1ETYesEastern
32Michigan105:00-1ETYesMost of state:UTC−05:00ESTEastern Standard Time
33Michigan206:00-1CTYesUpper Peninsula counties borderingWisconsin:UTC−06:00CSTCentral Standard Time
34Minnesota06:00-1CTYesCentral
35Mississippi06:00-1CTYesCentral
36Missouri06:00-1CTYesCentral
37Montana07:00-1MTYesMountain
38Nebraska106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
39Nebraska207:00-1MTYesNebraska Panhandle, counties withColoradoas a western boundary, and the westernSand Hills:UTC−07:00MSTMountain Standard Time
40Nevada107:00-1MTYesWest Wendovercity limits:UTC−07:00MSTMountain Standard Time
41Nevada208:00-1PTYesMost of state:UTC−08:00PSTPacific Standard Time
42New Hampshire05:00-1ETYesEastern
43New Jersey05:00-1ETYesEastern
44New Mexico07:00-1MTYesMountain
45New York05:00-1ETYesEastern
46North Carolina05:00-1ETYesEastern
47North Dakota106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
48North Dakota207:00-1MTYesWest of theMissouri River(exceptMortonandOlivercounties, and parts ofDunn,McKenzie, andSiouxcounties:UTC−07:00MSTMountain Standard Time
49Northern MarianaIslands10:001ChTNoChamorro
50Ohio05:00-1ETYesEastern
51Oklahoma06:00-1CTYesCentral (Kentonobserves Mountain time on ade factobasis)
52Oregon107:00-1MTYesNorthern 80% ofMalheur County:UTC−07:00MSTMountain Standard Time
53Oregon208:00-1PTYesMost of state:UTC−08:00PSTPacific Standard Time
54Pennsylvania05:00-1ETYesEastern
55Puerto Rico04:00-1ATNoAtlantic Standard Time
56Rhode Island05:00-1ETYesEastern
57South Carolina05:00-1ETYesEastern
58South Dakota106:00-1CTYesEastern half of state:UTC−06:00CSTCentral Standard Time
59South Dakota207:00-1MTYesWestern half of state:UTC−07:00MSTMountain Standard Time
60Tennessee105:00-1ETYesEast Tennessee, exceptBledsoe,Cumberland, andMarionCounties:UTC−05:00ESTEastern Standard Time
61Tennessee206:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
62Texas106:00-1CTYesMost of state:UTC−06:00CSTCentral Standard Time
63Texas207:00-1MTYesEl PasoandHudspethcounties:UTC−07:00MSTMountain Standard Time
64U.S. Minor Outlying Islands10.51NoWake Island:UTC+12:00(Wake Island Time Zone)
65U.S. Minor Outlying Islands20.5-1NoBaker IslandandHowland Island:UTC−12:00
66U.S. Minor Outlying Islands311:00-1STNoJarvis Island,Kingman Reef,Midway Atoll, andPalmyra Atoll:UTC−11:00(Samoa Time)
67U.S. Minor Outlying Islands410:00-1HTNoJohnston Atoll:UTC−10:00(Hawaii–Aleutian Time)
68U.S. Minor Outlying Islands505:00-1ETNo
69Utah07:00-1MTYesMountain
70Vermont05:00-1ETYesEastern
71Virgin Islands (U.S.)04:00-1ATNoAtlantic
72Virginia05:00-1ETYesEastern
73Washington08:00-1PTYesPacific
74West Virginia05:00-1ETYesEastern
75Wisconsin06:00-1CTYesCentral
76Wyoming07:00-1MTYesMountain
Sheet4
Cell Formulas
RangeFormula
C2:C5C2=$A2-XLOOKUP($B2,$G$2:$G$76,$H$2:$H$76)*XLOOKUP($D2,$G$2:$G$76,$I$2:$I$76)
E2:E5E2=$C2+XLOOKUP($D2,$G$2:$G$76,$H$2:$H$76)*XLOOKUP($D2,$G$2:$G$76,$I$2:$I$76)
 
Upvote 0
The downloadable file contains data comprised of ZIP, STATE, CITY, LAT, LONG, TimeZone, UTC Time in H1 and the local time for each zip code in Column G.
There are two buttons ... one that starts the macro and one that stops the macro.

From the HOME tab you can select "FIND & SELECT" and use the search function to locate the zip code of interest. The cursor will jump to and highlight
the zip code searched for allowing you to view the local time in that area.

You can position the search form to the right of all the data and leave it displayed allowing quick access to the search feature.

The macro is set to auto update every 30 seconds. This will give you sufficient time to search for a zip code without being interrupted by the update action. Depending on when you click
START will determine how close to the beginning of an actual minute the time display will be. I trust your 'time requirement' does not require an exact time ?

When closing the workbook you may be presented with a notice regarding ActiveX components, Objects, etc, etc. Just click OK and ignore the message.

VBA Code:
Option Explicit

Dim KeepUpdating As Boolean

Sub StartUpdatingTime()
    KeepUpdating = True
    Call UpdateTime
End Sub

Sub StopUpdatingTime()
    KeepUpdating = False
End Sub

Sub UpdateTime()
    Dim ws As Worksheet
    Dim lastRow As Long
    Dim i As Long
    Dim utcTime As Date
    Dim timeZone As String

    Set ws = Worksheets("Sheet1")
    utcTime = Now - TimeZoneOffset()
    ws.Range("H1").Value = utcTime

    ' Determine the last row in column F with data
    lastRow = ws.Cells(ws.Rows.Count, "F").End(xlUp).Row

    ' Loop through each time zone in column F and calculate local time in column G
    For i = 1 To lastRow
        timeZone = ws.Cells(i, "F").Value
        Select Case LCase(timeZone)
            Case "eastern": ws.Cells(i, "G").Value = utcTime - TimeSerial(5, 0, 0)
            Case "central": ws.Cells(i, "G").Value = utcTime - TimeSerial(6, 0, 0)
            Case "mountain": ws.Cells(i, "G").Value = utcTime - TimeSerial(7, 0, 0)
            Case "pacific": ws.Cells(i, "G").Value = utcTime - TimeSerial(8, 0, 0)
            Case "alaska": ws.Cells(i, "G").Value = utcTime - TimeSerial(9, 0, 0)
            Case "hawaii": ws.Cells(i, "G").Value = utcTime - TimeSerial(10, 0, 0)
            Case "atlantic": ws.Cells(i, "G").Value = utcTime - TimeSerial(4, 0, 0)
            Case Else:
        End Select
    Next i

    If KeepUpdating Then
        Application.OnTime Now + TimeValue("00:01:00"), "UpdateTime"
    End If
End Sub

Function TimeZoneOffset() As Double
    TimeZoneOffset = TimeSerial(-5, 0, 0) ' Adjusting by +5 hours
End Function

Download file : Internxt Drive – Private & Secure Cloud Storage
 
Last edited:
Upvote 0
I'm doing some updating to the workbook. I'll post a new download link soon.
 
Upvote 0
Dear DPChristman and Excel Forum :

I offer my most sincere apologies to all for my sloppy attempts of providing an answer to DPChristman's post.

Generally I am able to create a solution to posts in short order. This time that was not the case. Each time
I posted an answer it was honestly felt the answer was complete. They weren't as is obvious from following
this thread.

Again I apologize. There is a health issue that could be offered as a reason for my shortcomings but doing so
wouldn't change anything ... the errors are still there.

Here I have (as the old saying goes - "If you don't succeed the first time, try ... try ... again.") made numerous
changes to the coding and the workbook since my last posting. I checked ... double checked ... and triple checked
everything. Then I checked it again - not willing to accept anything prematurely.

I am hesitant to post the updated/edited version of the workbook again for obvious reasons. BUT ... I owe
DPChristman a working answer to his request. And I owe the same to the 'Mr Excel Forum'.

So ... here goes. May the Excel gods be with me ...

(If it is possible for a Moderator to delete my previous posts ... that would be a 'god send'. I would be forever
grateful.)

A portion of the code :


VBA Code:
Sub Update_Time()
    Dim ws As Worksheet
    Dim lastRow As Long
    Dim i As Long
    Dim utcTime As Date
    Dim timeZone As String
    Dim sn
    
    Set ws = Worksheets("Sheet1")
    utcTime = Now - TimeZoneOffset()
    
ws.Range("K1").Value = ""
ws.Range("K2").Value = ""
    
' Determine array size from column F data
    sn = ws.Range("F2", ws.Range("F" & ws.Rows.Count).End(xlUp)).Resize(, 2)

' Loop through each time zone in column F and calculate local time in column G
    For i = 1 To UBound(sn)
        'timeZone = ws.Cells(i, "F").Value
        Select Case LCase(sn(i, 1))
            Case "eastern": sn(i, 2) = utcTime - TimeSerial(5, 0, 0)
            Case "central": sn(i, 2) = utcTime - TimeSerial(6, 0, 0)
            Case "mountain": sn(i, 2) = utcTime - TimeSerial(7, 0, 0)
            Case "pacific": sn(i, 2) = utcTime - TimeSerial(8, 0, 0)
            Case "alaska": sn(i, 2) = utcTime - TimeSerial(9, 0, 0)
            Case "hawaii": sn(i, 2) = utcTime - TimeSerial(10, 0, 0)
            Case "atlantic": sn(i, 2) = utcTime - TimeSerial(4, 0, 0)
            Case Else:
        End Select
    Next i
    ws.Range("F2").Resize(UBound(sn), 2) = sn
    
    'ws.Range("K2").Value = utcTime
  
    Clock

End Sub


Internxt Drive – Private & Secure Cloud Storage
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top