Sure. I use the following to convert from local time zone (based on the Windows time zone setting) to UTC. Because of the switch this year, the function needed some additional If… Then logic. In this example I’m taking an end date based on the {?Date Range} parameter, adding enough hours to make it the equivalent of 23:59:59 and then checking to see what time period the date falls in. If it is prior to the whole DST change in 2007 it does one thing, else another.
DateTimeVar vEndDate;
vEndDate := (if HasUpperBound ({?Date Range}) = true then maximum({?Date Range}) else Date (2025, 12, 31));
vEndDate := vEndDate + 23.99999/24;
if year(vEndDate) <= 2006 and
vEndDate <= datetime((date(year(vEndDate),4,1) + 7 - dayofweek(date(year(vEndDate),4,1)-1)), ctime("2:00 AM")) and
vEndDate >= datetime(date(year(vEndDate),3,1) + 14 - dayofweek(date(year(vEndDate),3,1)-1), ctime("2:00 AM")) and
Mid (DataTimeZone, InStr(InStr (1, DataTimeZone , ",") + 1, DataTimeZone, ",") + 1, 1) +
Mid (DataTimeZone, InStr (InStr(InStr (1, DataTimeZone , ",") + 1, DataTimeZone, ",") + 1, DataTimeZone, " " ) + 1, 1) +
Mid (DataTimeZone, InStr (InStr (InStr(InStr (1, DataTimeZone , ",") + 1, DataTimeZone, ",") + 1, DataTimeZone, " " ) + 1, DataTimeZone, " ") + 1, 1)
in ["ADT", "MDT", "CDT", "EDT"]
then
ShiftDateTime (vEndDate, "", "UTC,0") - (1/24)
else
ShiftDateTime (vEndDate, "", "UTC,0")
JonTarz
(BOB member since 2006-01-09)