Robert Rolf wrote: > So why isnt' Time_t stored as an UNSIGNED integer since time > cannot be negative? Gives us another 68 years ;-). Because generic C coders don't think of specifying UNSIGNED. It's also probably not specifically a 32 bit integer, probably just INT in whatever compiler the OS was compiled with, which could change. This is another thing C coders rarely consider. > And what kind of 'expert' says "the problem is only with 32 bit > computers. 64 bit computers will be the norm in a few years"? > The problem occurs TODAY with long term date calculations like > mortgages and land leases and life insurance. Only when people were dumb enough to use the TIME_T data type directly. I realized this was a problem with various operating systems long ago (by the way, the Domain/OS rollover already occurred something like 10 years ago). Lots of operating systems do it in a different way. There are differences between Unix systems too if I remember right. I don't remember what Windows uses internally, but it's probably not the same. I've been using a portable time specifier for something like 15 years now. It's fixed point 60.30 seconds since the start of year 2000. Yes that means it was negative when I first started using it and it's now positive. As different operating systems for getting the time change, all I have to do is rewrite one routine that converts from the local system method to the portable time specifier and all the rest of my code will just work. Here is the excerpt from my SYS library include file that defines the portable time descriptor: { * Clock time descriptor. This descriptor can hold either an absolute or * relative time value. It is the low level portable time descriptor. * An absolute value of zero indicates the start of the year 2000. * * The time descriptor is a 60.30 fixed point number, representing seconds. * Since 90 bit numbers are not generally available, 3 fields of 30 bits each * are used. The time value is stored as a twos complement number. * * The time descriptor therefore has a resolution of 2**(-30) seconds, or * about 931 pico seconds. It has a maximum value of 2**59 seconds, or * about 18 billion years. (Current scientific estimates put the age of * the universe at around 15 billion years, and Earth's age at 4.5 billion * years). } sys_clock_t = record {portable absolute or relative clock values} high: 0..1073741823; {2**30 seconds} sec: 0..1073741823; {whole seconds} low: 0..1073741823; {fractions of a second, units of 2**(-30) sec} rel: boolean; {TRUE for relative time value} end; sys_clock_p_t = ^sys_clock_t; ****************************************************************** Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC consultant in 2004 program year. http://www.embedinc.com/products -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist