restored parse date function