Set System DateTime

  • Thread starter Thread starter Romain TAILLANDIER
  • Start date Start date
R

Romain TAILLANDIER

Hi group

I have to set the datetime of my WinCE 4.2.
I search the net. I found that :
http://msdn.microsoft.com/smartclient/understanding/netcf/FAQ/default.aspx#6
..16

I try a few date, and it seems to have a min value for the DateTime of the
system near 1980, and a max value near 2050. I am able to set manually
(using control panel) the datetime from 1752 to 2999 but on validating the
option i get date from 1980 to 2047.

the man of SYTEMTIME structure for WinCe never specify the limit.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcesdkr/htm
l/wcesdkrSYSTEMTIME_str.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcekernl/ht
ml/_wcesdk_win32_SYSTEMTIME_str.asp


can i dream of a managed Compact Framework fonction to setup the current
datetime of the system ??

supposing the DateTime will never outpassing the 1980-2047 limits, is the 2
functions will work correctly ?

Thank for your help
ROM
 
You can use OpenNETCF's source, which includes a simple wrapper for
SetSystemTime(). The limit is probably one dependent on hardware, more than
on the contents of SetSystemTime(). The year in the SYSTEMTIME structure is
a 16-bit value, so any year up to 65535 can be represented. Whether your
board can handle a year like that depends on your hardware and I'm fairly
confident that the limits you are seeing are being enforced, not be Windows
CE, but by your OAL code.

Paul T.
 
Back
Top