should do the trick. Of course, if the RTC has never been set, you’ll have to add some logic to test for that.
 Also, the code you posted is out of order. It is not clear what your dateTime variable is set to before you use it. Not sure if you even need the first line. You should run the second line only after you have confirmed the NTP call worked. If I remember right (dubious assertion ;)) Nicolas3’s NTP function also sets the RTC, but best to check.
Essentially, it looks like you are setting the RTC from the System DateTime, which always initializes to 0 when you deploy/restart. This negates anything the NTP function did to set the RTC (if it even does) previous to the restart.