Updated to match date.c