ColeDateTime stores a time stamp value without information about time zone and DST. It is up to you to know if the value is local time or UTC. If you use COleDateTime::GetCurrentTime to initialise it, it will hold a local time value. If you use the constructor or assignment operator accepting a time_t or _time64_t value, it will be UTC when the time_t value has been retrieved using time() and not adjusted afterwards.
If you need to store time stamp values for later use, store them as UTC. This avoids wrong values and simplifies calculation of time spans. If you need to display times as local times, perform the conversion just before display.
Hello Jochen, I was not aware that the timestamp obtained from COleDateTime would depend on how the object was initialised. Therefore in my test code the object epoch would result in a UTC value, whereas that obtained from the other object (which initialised via GetCurrentTime()) would be localtime. This then blows my "difference" explanation as to why the result from CTime is 3600 seconds different from the COleDateTimeSpan object. My Arduino code expects time quantities to be received as localtime (i.e. adjusted for DST)
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.
Sample Input: Sample Output: