improved date processing