Script modified to include less complicated retrieval of date string