Hello Listers, I've calculated the date and time offset between 1904, Jan 1 midnight and 1970 as :
time_t offset = (365*66 + 17 ) *24*3600
1. I'd just like to know if my calculations are ok. The 17 accounts for the extra day in the 17 leap years which occur in this interval. 2. I gathered that Mac uses GMT and the standard C-library time.h bases its calculations on UTC. Would this create any further offset to what I'm considering right now ? If so what would it be ? 3. I also gathered that HFS uses local time and HFS plus uses GMT. Would it be a mistake to save up HFS dates as GMT ? In what way could this create problems ?
Could anybody who knows more about this please help me out ?.. would be grateful for any tips / suggestions.
Regards, Nandini Hengen
I've calculated the date and time offset between 1904,
Jan 1 midnight and 1970 as :
time_t offset (365*66 + 17 ) *24*3600
Seems to agree with the value in the hfsutils source.
- I'd just like to know if my calculations are ok. The 17 accounts for
the extra day in the 17 leap years which occur in this interval. 2. I gathered that Mac uses GMT and the standard C-library time.h bases its calculations on UTC. Would this create any further offset to what I'm considering right now ? If so what would it be ? 3. I also gathered that HFS uses local time and HFS plus uses GMT. Would it be a mistake to save up HFS dates as GMT ? In what way could this create problems ?
No idea - you may want to look at the hfsutils source and see how it deals with times ...
James Pearson