Thanks Heath, Had totally missed the ref bit. Changed the declaration to what you suggested and then there were compile errors on the SetSystemTime call. Changed it to ” result = SetSystemTime(ref timeStru);” and also changed the result from int to bool. It works now. The reason for P/Invoke being public was that I cut and pasted it from a forum. My technique in building applications is to write and test little functions separately before moulding them into the final source. So these little stubs are often a bit sloppy. Thanks again benny