Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting time in different time zones

Status
Not open for further replies.

farbodf

MIS
Nov 29, 2000
4
US
Is there a function available in VBA that converts a time variable from one time zone to another time zone?
 
I don't think so, but you can add and subtract hours. For example, to add 5 hours:
datStartTime = datStartTime + (5 / 24)
This is because date/time variables are like floating point numbers where the integer part is the number of days since (whatever the starting date is, it doesn't matter here) and the fractional part is the fraction of one day that the time represents. Thus 6:00 AM is 6/24 of a day, so the fractional part is .25. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top