Modified FormatDate Function