Is there a way to set system time from my app running on a Raspberry Pi 2 in Windows 10 IoT Core Insider Preview?
This doesn\'t work for lack of kernel32.dll
<
1-New Universal Project
2-Add Reference>Extensions>Windows IOT Extensions for UWP
3- Put a button, a datepicker and a timepicer control on your MainPage.xaml
and
private void buttonSetSystemDatetime_Click(object sender, RoutedEventArgs e)
{
DateTimeOffset dto = datePicker1.Date+ timePicker1.Time;
Windows.System.DateTimeSettings.SetSystemDateTime(dto);
}
4- in poject settings> set your target version and min version 10.0; build 16299
5- double click appxmanifest > Capabilities > check ON "System Management"
6- run app in IOT and press button. than return to default app. voila! system datetime changed.
note: rather to set it everytime. I offer you buy a cheap rtc (real time clock) module. (also needs extra coding)