lojix/power_model/src/main/com/thesett/aima/attribute/time/TimeUtils.java
public static long timestampToTicks(int year, int month, int day, int hours, int minutes, int seconds,
        int milliseconds)
    {
        boolean isLeapYear = isLeapYear(year);

        long dayComponent = (long) (day - 1) * MILLIS_PER_DAY;
        long monthComponent = millisToStartOfMonth(month, isLeapYear);
        long yearComponent = millisToYearStart(year);
        long hoursComponent = (long) hours * MILLIS_PER_HOUR;
        long minutesComponent = (long) minutes * MILLIS_PER_MINUTE;
        long secondsComponent = (long) seconds * MILLIS_PER_SECOND;

        return dayComponent + monthComponent + yearComponent + hoursComponent + minutesComponent + secondsComponent +
            milliseconds;
    }
public static long timestampToTicks(int year, int month, int day, int hours, int minutes, int seconds,
        int milliseconds)
    {
        boolean isLeapYear = isLeapYear(year);

        long dayComponent = (long) (day - 1) * MILLIS_PER_DAY;
        long monthComponent = millisToStartOfMonth(month, isLeapYear);
        long yearComponent = millisToYearStart(year);
        long hoursComponent = (long) hours * MILLIS_PER_HOUR;
        long minutesComponent = (long) minutes * MILLIS_PER_MINUTE;
        long secondsComponent = (long) seconds * MILLIS_PER_SECOND;

        return dayComponent + monthComponent + yearComponent + hoursComponent + minutesComponent + secondsComponent +
            milliseconds;
    }
public static long timestampToTicks ( int year , int month , int day , int hours , int minutes , int seconds , int milliseconds ) { boolean isLeapYear = isLeapYear ( year ) ; long dayComponent = ( long ) ( day - 1 ) * MILLIS_PER_DAY ; long monthComponent = millisToStartOfMonth ( month , isLeapYear ) ; long yearComponent = millisToYearStart ( year ) ; long hoursComponent = ( long ) hours * MILLIS_PER_HOUR ; long minutesComponent = ( long ) minutes * MILLIS_PER_MINUTE ; long secondsComponent = ( long ) seconds * MILLIS_PER_SECOND ; return dayComponent + monthComponent + yearComponent + hoursComponent + minutesComponent + secondsComponent + milliseconds ; }
Converts a field by field timestamp into millisecond ticks.

@param  year         The year.
@param  month        The month.
@param  day          The day.
@param  hours        The hours.
@param  minutes      The minutes.
@param  seconds      The seconds.
@param  milliseconds The milliseconds.

@return Millisecond ticks since midnight 01/01/1970.
Converts a field by field timestamp into millisecond ticks .