how to change date & time in C# for PPC
-
I've only been able to manage that by using calls to the windows APIs which only work on some PDAs (on my development Dell X51V it works, on some Symbols it doesn't. I'm not sure why - no exception or anything, just the time doesn't change) Hope that helps, but maybe someone knows a C# way of doing that. Martin [DllImport("coredll.dll")] public extern static void GetSystemTime(ref SYSTEMTIME lpSystemTime); [DllImport("coredll.dll")] public extern static uint SetSystemTime(ref SYSTEMTIME lpSystemTime); public struct SYSTEMTIME { public ushort wYear; public ushort wMonth; public ushort wDayOfWeek; public ushort wDay; public ushort wHour; public ushort wMinute; public ushort wSecond; public ushort wMilliseconds; } public static void setSystemDate(DateTime newTime) { // Set the clock to this time SYSTEMTIME st = new SYSTEMTIME(); st.wMilliseconds = (ushort)newTime.ToUniversalTime().Millisecond; st.wSecond = (ushort)newTime.ToUniversalTime().Second; st.wMinute = (ushort)newTime.ToUniversalTime().Minute; st.wHour = (ushort)newTime.ToUniversalTime().Hour; st.wDay = (ushort)newTime.ToUniversalTime().Day; st.wMonth = (ushort)newTime.ToUniversalTime().Month; st.wYear = (ushort)newTime.ToUniversalTime().Year; //GetSystemTime(ref st); //st.wHour = (ushort)(st.wHour + 1 % 24); SetSystemTime(ref st); }