More elegant cross-platform date logic.