Hello everybdoy, thanks for the assistance. I tested FredZones code by selecting London time zone and it didn't work.
I replaced my select statement with this:
The original code works for London (which is last sunday of march, and last sunday of october). However your code does work for the US canada.Code:Dim iFirstDay As Integer Dim iDay As Integer iFirstDay = Weekday(DateSerial(tziYear, .wMonth, 1), vbSunday) iDay = .wDayOfWeek + 1 If iFirstDay > iDay Then iDay = 9 - iFirstDay iDay = iDay + (7 * (.wDay - 1)) tmp = DateSerial(tziYear, .wMonth, iDay) + TimeSerial(.wHour, .wMinute, .wSecond)
I found this site which states the different daylight savings times:
http://www.webexhibits.org/daylightsaving/g.html
I need something that can always work in all timezones. Thanks.




Reply With Quote