Improved getFormatedDate