web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / V2CalendarPostItem to ...
Power Apps
Answered

V2CalendarPostItem to Outlook before and after DST change

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

after DST.png
before DST.png
Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    Do you need the TimeZoneOffset?

    We use the calendar posting and don't use it, just a straight date/time.

     

    However, if you do need it, then I believe your issue is that you are not telling the TimeZoneOffset what the date is for the TimeZoneOffset.

    TimeZoneOffset without the optional "Date" parameter will return the offset for the current date.

    So, I believe, in this case, you would want to put the start and end dates in the parameter for the function:

     

            DateAdd(EditLeaveStart, -TimeZoneOffset(EditLeaveStart),Minutes),

            DateAdd(EditLeaveEnd, -TimeZoneOffset(EditLeaveEnd),Minutes)

     

    Hope that helps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Randy. That's what I missed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard