First off, you should convert the dates into timestamps when manipulating them in C, either seconds, nanoseconds, etc. This will simplify your life a great deal.
How are you accessing the data? Do you just go through the data sequentially? Do you look for particular timestamps? Or do you...