using DateTime perl module, replacing my code