Common Pitfalls with time_t in C++ and How to Avoid Them