in reply to 2038 bug
Not so much a way to fix the code, but a way to fix the program... Document it. If the code is complicated enough to worry about the 2038 issue, then it should be complicated enough to require proper specification and other documents. Add "This code will choke on dates past 2038" (as someone else pointed out, you can hit these bugs well before 2038, if you're calculating dates into the future) If people are aware of this every time they read the docs, it'll make it hard for them to build things on top which will inherit the same problems, and break in difficult to diagnose ways.