handle different date formats