Factorize some functions

While getting month and year property you call format twice.
I call IT in fact only once for an instance