fullRuntime/src/sc/util/zip/ZipUtil.java
public static byte[] toDosTime(long t) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(t);

        int year = c.get(Calendar.YEAR);
        if (year < 1980) {
            return copy(DOS_TIME_MIN); // stop callers from changing the array
        }
        int month = c.get(Calendar.MONTH) + 1;
        long value =  ((year - 1980) << 25)
            |         (month << 21)
            |         (c.get(Calendar.DAY_OF_MONTH) << 16)
            |         (c.get(Calendar.HOUR_OF_DAY) << 11)
            |         (c.get(Calendar.MINUTE) << 5)
            |         (c.get(Calendar.SECOND) >> 1);
        return ZipLong.getBytes(value);
    }
/**
     * Convert a Date object to a DOS date/time field.
     *
     * <p>Stolen from InfoZip's <code>fileio.c</code></p>
     * @param t number of milliseconds since the epoch
     * @return the date as a byte array
     */
Convert a Date object to a DOS date/time field.
Stolen from InfoZip's fileio.c
@param t number of milliseconds since the epoch
@return the date as a byte array
Convert a Date object to a DOS date / time field . Stolen from InfoZip ' s fileio . c @param t number of milliseconds since the epoch @return the date as a byte array
public static byte[] toDosTime(long t) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(t);
        int year = c.get(Calendar.YEAR);
        if (year < 1980) {
            return copy(DOS_TIME_MIN); 
        }
        int month = c.get(Calendar.MONTH) + 1;
        long value =  ((year - 1980) << 25)
            |         (month << 21)
            |         (c.get(Calendar.DAY_OF_MONTH) << 16)
            |         (c.get(Calendar.HOUR_OF_DAY) << 11)
            |         (c.get(Calendar.MINUTE) << 5)
            |         (c.get(Calendar.SECOND) >> 1);
        return ZipLong.getBytes(value);
    }
public static byte [ ] toDosTime ( long t ) { Calendar c = Calendar . getInstance ( ) ; c . setTimeInMillis ( t ) ; int year = c . get ( Calendar . YEAR ) ; if ( year < 1980 ) { return copy ( DOS_TIME_MIN ) ; } int month = c . get ( Calendar . MONTH ) + 1 ; long value = ( ( year - 1980 ) << 25 ) | ( month << 21 ) | ( c . get ( Calendar . DAY_OF_MONTH ) << 16 ) | ( c . get ( Calendar . HOUR_OF_DAY ) << 11 ) | ( c . get ( Calendar . MINUTE ) << 5 ) | ( c . get ( Calendar . SECOND ) >> 1 ) ; return ZipLong . getBytes ( value ) ; }
Convert a Date object to a DOS date/time field.
Convert a Date object to a DOS date / time field .
// stop callers from changing the array