For a calendar item created in PowerApps, the date offset in Outlook 365 is different before and after Daylight Savings Time change. In this case, DST is March 10, 2019.
For testing, I create two leave requests, both 8:30 AM – 5:00 PM. One is created before the time change. The other is created after the time change.
If the user requests the day off on the Friday 3/8/2019 (BEFORE DST), the resulting event is correct: 8:30 AM – 5:00 PM.
If the user requests the day off on the Monday 3/11/2019 (AFTER DST), the resulting event is wrong: 7:30 AM – 4:00 PM.
EditLeaveStart and EditLeaveEnd are text values created from a combination of Date Picker and a text field.
Here’s the code that creates the Outlook calendar entry:
/*create start and end datetimes*/
Set(EditLeaveStart, DateTimeValue(NRSelectDatesFromDatePicker & " " & NRDropdownHoursFrom.Selected.Value));
Set(EditLeaveEnd, DateTimeValue(NRSelectDatesToDatePicker & " " & NRDropdownHoursTo.Selected.Value));
/*write to calendar*/
Office365.V2CalendarPostItem(
SFICalendarID,
Text("Pending ") & ThisLeaveType & Text(" request for ") & Office365Users.UserProfile(MyProfile.Id).DisplayName,
DateAdd(EditLeaveStart, -TimeZoneOffset(),Minutes),
DateAdd(EditLeaveEnd, -TimeZoneOffset(),Minutes),
{
Body: "Hours requested: " & EditRequestHours,
TimeZone: "Eastern Standard Time",
IsHtml: true,
Location: ThisCalID,
IsAllDay: false,
Reminder:0
}
);
Resulting appointments in the attachments:
Created before the time change.
Created after the time change.
Any help would be appreciated.