Java Calendar Time sameTime(Calendar one, Calendar two)

Here you can find the source of sameTime(Calendar one, Calendar two)

Description

Returns true if the two given calendars are dated on the same time.

License

Apache License

Parameter

Parameter Description
one The one calendar.
two The other calendar.

Return

True if the two given calendars are dated on the same time.

Declaration

public static boolean sameTime(Calendar one, Calendar two) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {
    /**//from  ww w. j a v  a2s  .  c  o m
     * Returns <tt>true</tt> if the two given calendars are dated on the same time. The difference
     * from <tt>one.equals(two)</tt> is that this method does not respect the time zone.
     * @param one The one calendar.
     * @param two The other calendar.
     * @return True if the two given calendars are dated on the same time.
     */
    public static boolean sameTime(Calendar one, Calendar two) {
        return one.getTimeInMillis() == two.getTimeInMillis();
    }
}

Related

  1. removeTime(final Calendar date)
  2. resetTime(Calendar cal)
  3. resetTime(Calendar cal)
  4. resetTime(GregorianCalendar cal)
  5. roundTime(double dt, Calendar tmp)
  6. setDateTimeByString(Calendar theDateTime, String str)
  7. setTime(Calendar cal, int h, int m, int s, int ms)
  8. setTime(Calendar cal, String time)
  9. setTime(final Calendar calendat, final String[] test)