I'm building a canvas app for a school project and could use some help figuring this one out.
I have a simple screen where I wish to generate an event and post it to the current user's calendar. I have little issue with anything else except for the start time.
I am converting date and time stored in a text value elsewhere (in labels) on the screen to a datetime and using DateAdd() to make the datetimetimezone object needed for the V4CalendarPostItem() function. This is a simplified version of what I am doing:
Office365Outlook.V4CalendarPostItem(
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName="Calendar").Name,
ATCEEDCNValue.Text,
DateAdd(DateTimeValue(ATCEEDBDValue.Text & " " & TimeValue(ATCEEDEDST1Value.Text)), TimeZoneOffset(), Minutes),
DateAdd(DateTimeValue(ATCEEDEDValue.Text & " " & TimeValue(ATCEEDEDET1Value.Text)), TimeZoneOffset(), Minutes),
"UTC",
{
...
}
)
When an event is posted to my calendar the start time is off. I would expect it to have the correctly converted start and end time, but it seems that only the end time is coming through correctly. Dates and everything else are as expected.
Here is an example:
The event should be from 3:00PM ET to 5:30PM ET. When in actuality, what I get is:

And, in the details where you can see the "real" timezone, you can see the UTC did not come through correctly:

This error is also reflected in-code upon highlighting (shown below), I just have no idea what's going on. Can someone help me figure out why I am getting 1 incorrect and 1 correct conversion with the same exact format/datatypes/etc.? Am I not creating the datetimetimezone object correctly?
---------------
DateTimeValue picks up correct time and date for start time

Conversion to UTC is incorrect

DateTimeValue picks up correct time and date for end time

Conversion to UTC is correct
