Change convertToDate from a static method