VBA state time

bensonsearch

Well-known Member
Joined
May 26, 2011
Messages
844
Hi All,

I have a project that I need the state times (for Australia) showing at all times. I can get it with the below (and its kept in real time no worries) but is there an easier way to adjust the states esp when daylight savings time comes around? otherwise I need to adjust code constantly as different states do/dont have daylight savings
Code:
Dim asd As String
Dim dsa As String
Dim sa As String
 
dsa = Format(time - TimeValue("02:00:00"), "short time")
asd = Format(time, "short time")
sa = Format(time - TimeValue("00:30:00"), "short time")
Home.Label6.Caption = asd
Home.Label5.Caption = asd
Home.Label4.Caption = asd
Home.Label2.Caption = dsa
Home.Label3.Caption = sa
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

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