Added method for parsing date from string.