How to handle time zone adjustments in a customization
The PlanetTogether scheduler performs all of its operations using the UTC time. To easily convert from UTC to Local time or vice versa, we can use some functions located in PT.Common.TimeZoneAdjuster.
This small example illustrates how to convert between local and UTC DateTime objects:
private DateTime ConvertToUTC(DateTime a_dateTime)
DateTime utcDate = PT.Common.TimeZoneAdjuster.ConvertToServerTime(a_dateTime);
private DateTime ConvertToLocal(DateTime a_dateTime)
DateTime localDate = PT.Common.TimeZoneAdjuster.GetDisplayTime(a_dateTime);
Explore the following articles to learn all there is to know about customization projects in PlanetTogether: