created subroutines for date parsing - needed for some external work