Code example for Date

Methods: getDate, getMonth, getYear

0
     * @param date Date to convert to ordinal, since 01/01/01 
     * @return The ordinal representing the date 
     */ 
    public static int dateToOrdinal(Date date) {
        // BigDate.toOrdinal returns the ordinal since 1970, so we add up the days from 01/01/01 to 1970 
        return BigDate.toOrdinal(date.getYear() + 1900, date.getMonth() + 1, date.getDate()) + DAYS_BEFORE_1970;
    } 
 
 
    /** 
     * Return the date corresponding to the proleptic Gregorian ordinal, where January 1 of year 1 has ordinal 1. 
     * @param ordinal representing the days since 01/01/01 
     * @return Date converted from the ordinal 
     */ 
    public static Date ordinalToDate(int ordinal) {
        return new Date((ordinal - DAYS_BEFORE_1970) * MILLIS_IN_A_DAY);
    } 
 
 
    /** 
     * Indicates whether the specified action can be used as an intent. This method queries the package manager for