Search code examples
c#windows-mobile-5.0

is there any C# sample code for updating the time and date on Windows Mobile?


Is there any C# sample code for updating the time and date on Windows Mobile?


Solution

  • I don't have any exact sample, but you can do it by PInvoking SetSystemTime. The PInvoke page for SetSystemTime has some sample code which I'd thought would be very similar to the CF version and if there are any differences in doing PInvoke on Windows mobile you could probably find that out on this page: An Introduction to P/Invoke and Marshaling on the Microsoft .NET Compact Framework

    Actually, might be easier than that even, I just found this page How to: Get or Set the System Time which seems to be CF specific...