I am using Windows Mobile 6.5 SDK with C# 3.5. I need to change the mobile date/time with Server(ASP.NET) date/time. I am unable to find anything.
Update: I am dealing with the timezone issue. If server and client are on same timezone then I have no issue. But if timezone differs I am facing issue.
Changing the time on the mobile isn’t hard – the openNETCF helper makes it easier otherwise you need to do something like:
Where SYSTEMTIME is:
And LocalClockOffset is the pre-calculated difference between the desired time and the current time.
The other part of your query is now to sync with the server. If you sync your server to say time-a.nist.gov, then you could also sync your mobiles to the same.
Valer Bocan has excellent code for this which is where the above came from. Link : http://www.bocan.ro/sntpclient
I’ve not done this but it’s probably possible to have your server also act as a time server and instead point your mobiles to your server instead and use the same protocol ?
Lastly timezones – with my PDA projects i’ve been passing datetimes as GMT with the +/- offset from GMT.