datetimeConvertor function