While running the code from this example (A Power Efficient Refrigerator Monitor | Dev Center) the timestamp of the first reading is always Jan 1, 2000 if it starts from a cold boot after a power cycle. As mentioned in the post above, “The imp’s RTC time will be synced shortly after connecting.” But in practice, all the modifications I’ve tried to force a server connection prior to taking a reading have failed to update the time. Is there some method or pattern that will reliably force the time to be updated?
Like I said a couple of years ago, a power cycle will clear the clock. The imp will be adjusted to the correct time shortly after a connection is made. I deal with this in my code by testing the time value after a restart, setting a flag when I have determined that the time has been synchronised. If your imp cold starts and cannot get a connection, it could run without an accurate clock for an extended period until it finally connects.