The date class requires a valid date value so you can't use just year and month, maybe if you explain your ultimate goal, someone could give you an alternative approach.
Thanks andresrcs. I need year and month to sum up values based on month for particular year. This will help me to analysis data on month basis which the goal.