One thing I noticed when looking over the patch is that there are a few bare numbers in datetime.c such as 100000, 1000, 1e-3, and 1e-6. In timestamp.[hc] we've defined macros for conversions such as #define #define USECS_PER_SEC INT64CONST(1000000)
I'd like to work up a patch that would add similar macros for datetime.c, in particular using the INT64CONST construction where appropriate. Thoughts?