The glibc version of struct tm has additional fields
long tm_gmtoff; /* Seconds east of UTC */
const char *tm_zone; /* Timezone abbreviation */
(Ref: http://linux.die.net/man/3/ctime ) My question is: If I have a data called struct tm a and i would like to copy that to another struct tm b, as per below code:
time_t t = time(0);
const tm *pa = localtime(&t);
struct tm a;
if(pa) {
memcpy(&a, pa, sizeof(a));
}
But, what will happen to tm_gmtoff and tm_zone? How to copy these fields too?