What function will let us know whether a date in VBA is in DST or not?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For non-current dates (DST 2007+):
First, you need a function to find the number of specific weekdays in a month:
Then, you can check for the DST day versus the following function calls:
Fall: NDow(Year(newdate), 11, 1, 1)
Spring: NDow(Year(newdate), 3, 2, 1)
For the current date:
Call the Windows API function GetTimeZoneInformation, and it will return an enum (integer) with the status.
I got the code for this from Chip Pearson’s great Excel site.
Pearson’s site