accessors function

Generics for accessing the year, month and month-day of an object