added flag to indicate if only want year our of date