Here you can find the source of getTimeValue(Calendar cal)
Parameter | Description |
---|---|
cal | The calendar object or null to get a number based on the current time. |
public static long getTimeValue(Calendar cal)
//package com.java2s; // See LICENSE.txt for license information import java.util.Calendar; public class Main { /**/*from ww w.ja va 2 s.c om*/ * Returns a number based on the date and time of the specified Calendar object. * @param cal The calendar object or {@code null} to get a number based on the current time. * @return A comparable numeric value derived from the calendar object (higher = newer). */ public static long getTimeValue(Calendar cal) { if (cal == null) { cal = Calendar.getInstance(); } return cal.getTimeInMillis(); } }