added manual solution and solution using datetime library