I created a UserForm that contains a textbox that will show the current time in EST. The only problem is, the time that's reflecting is of course the current time in our country so I want to convert it in EST, which is - 12:00
from our time.
Private Sub UserForm_Initialize()
If ActiveWorkbook.MultiUserEditing Then
End If
Application.ScreenUpdating = False
Application.DisplayAlerts = False
txtDate.Value = Format(Now, "mm/dd/yyyy")
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Its far simpler if you want to use it in a formula. Use the NOW() function, and then subtract the difference using TIME function.
For example, I am in a timezone which is 9:30 hrs ahead of EST. So the get EST time, I'll take the current date-time in my timezone using NOW(), and then subtract 9 hrs 30 minutes from it using the following formula.
=NOW()-TIME(9,30,0)
Enjoy!
You need to use
TimeValue
function like this :A more complicated way than R3uK but I've always preferred using
TimeSerial()
andDateSerial()
to get my exact criteria setup (especially when you need to modify multiple parts of the Time).To show just the current date in EST: