lojix/power_model/src/main/com/thesett/aima/attribute/time/TimeUtils.java
public static long ticksWithMonthSetTo(long ticks, int month)
    {
        int year = ticksToYears(ticks);
        boolean isLeapYear = isLeapYear(year);
        int oldMonth = ticksToMonths(ticks);

        return ticks - millisToStartOfMonth(oldMonth, isLeapYear) + millisToStartOfMonth(month, isLeapYear);
    }
public static long ticksWithMonthSetTo(long ticks, int month)
    {
        int year = ticksToYears(ticks);
        boolean isLeapYear = isLeapYear(year);
        int oldMonth = ticksToMonths(ticks);

        return ticks - millisToStartOfMonth(oldMonth, isLeapYear) + millisToStartOfMonth(month, isLeapYear);
    }
Sets the month component of the timestamp, returning the new timestamp with updated component.

@param  ticks The time in ticks.
@param  month The new month field.

@return The new time in ticks.