AdaptiveDateInputRenderer has a capability to parse date in various format from the string parameter. This parameter can include time of the day besides year, month and day.
Function GetDateTime that's being used to convert that time to local time is not taking into account the tiem of day when converting. It can result in incorrect time calculation if the timezone is ahead of UTC by certain amount (need to investigate).
winrt::DateTime GetDateTime(unsigned int year, unsigned int month, unsigned int day)
{
// TODO: investigate the midnight bug. If the timezone will be ahead of UTC we can do -1 day when converting
SYSTEMTIME systemTime = {(WORD)year, (WORD)month, 0, (WORD)day};
// Convert to UTC
TIME_ZONE_INFORMATION timeZone;
GetTimeZoneInformation(&timeZone);
TzSpecificLocalTimeToSystemTime(&timeZone, &systemTime, &systemTime);
// Convert to ticks
FILETIME fileTime;
SystemTimeToFileTime(&systemTime, &fileTime);
return winrt::clock::from_FILETIME({fileTime});
}
Target Platforms
UWP
SDK Version
3.0.2
Application Name
N/A
Problem Description
AdaptiveDateInputRenderer has a capability to parse date in various format from the string parameter. This parameter can include time of the day besides year, month and day. Function GetDateTime that's being used to convert that time to local time is not taking into account the tiem of day when converting. It can result in incorrect time calculation if the timezone is ahead of UTC by certain amount (need to investigate).
Screenshots
No response
Card JSON
Sample Code Language
No response
Sample Code
No response