Created date to string method which use format strings in Date