Hi,
How can I get the time that is not based on my PC time? I use the code below to get time and it works, but when I change my computer time, the time is no longer correct, so is there a way that I can get the actual real time but not from PC time? Maybe GPS time?
private void btn_DateTime_Click(object sender, EventArgs e)
{
DateTime dateTime = DateTime.Now;
label_localTime.Text = dateTime.ToString();
DateTime utcNow = DateTime.UtcNow;
label_utc.Text = utcNow.ToString();
TimeZone timeZone = TimeZone.CurrentTimeZone;
if (timeZone.IsDaylightSavingTime(dateTime) == true)
{
label_dayLightSaving.Text = "YES";
label_timeZone.Text = timeZone.GetUtcOffset(dateTime).ToString();
}
else
{
label_dayLightSaving.Text = "NO";
label_timeZone.Text = "N//A";
}
}
EDIT: Target device is running on WM6 and it has GPS hardware.
thanks.