Main Site Documentation

Load PC's Date and Time during deployment?


Hello all,

How can I load the PC’s (engineering station’s) date and time in a FEZ during deployment of the program?


Not possible

I think this would be a nice feature to have but it must be added my Microsoft. Can you request it here please


+1. Seems rather odd that I have to implement ethernet to go get the time from the same NTP server my PC is already using. There are, of course, other ways to get an accurate time, but all that I have tried involve a fair amount of work for such a seemingly simple update. This was the first command I added to William’s FezTerm app.

@ WimC - let us know if you do log this on the netmf site. I’ll vote the heck out of it!


Some C/C++ compilers had preprocessor defines for TIME and DATE, but unfortunately C# doesn’t support them.

You could write a Macro to create or update a C# file with a special class when it is compiled (look under Properties>Build for Pre-Build and Post-Build events).


i’m not clear on the “problem statement”.

Do you want to load the system clock/RTC with the Date/Time as set on the PC when you deploy?

Do you want to have a Date/Time stamped onto the deployment so you know when the deployment was done, so you could use it “forensically” if you needed to understand what version of code was on a device?

I can see for 1) there’s some value in doing this, although not every board has RTC that will persist - but at least you’re on a known time when you deploy (not re-power a device)


Hi community.

@ Gus, if MS adds this feature, it will probably not be in micro framework.

@ Ron2, that is an entrance but it is probably easier to implement a front end on a PC and connect through Ethernet or USB to set the RTC.

@ Brett, your first suggestion is the correct one.
Nothing with a time stamp or release version or date. This could be done in a constant value.

Thanks for your answers.