0
votes

I'm using the Microsoft Graph API to retrieve my emails however, the received DateTime is an hour out. This only occurs during the summer so I'm guessing that the time is not adjusted for BST.

Is there a way (maybe something I can add to the request URL that) I can request the time to be displayed in the British Summer Time version?

The current URL I'm passing is: https://graph.microsoft.com/v1.0/me/mailFolders/{folderId}/messages.

I'm guessing not but I thought I would throw the question out there just in case.

1
The timestamp is UTC, so you can just convert based on thatHong Ooi

1 Answers

0
votes

I created a helper function to add an hour to the time if it falls within the local daylight saving period.

public static DateTime GetDaylightSavingDateTime(DateTime receivedDateTime)
{
    if (TimeZoneInfo.Local.IsDaylightSavingTime(receivedDateTime))
        return receivedDateTime.AddHours(1);
    return receivedDateTime;
}