diff --git a/src/com/android/contacts/common/util/DateUtils.java b/src/com/android/contacts/common/util/DateUtils.java
index c695ec6..097230c 100644
--- a/src/com/android/contacts/common/util/DateUtils.java
+++ b/src/com/android/contacts/common/util/DateUtils.java
@@ -18,8 +18,6 @@
 
 import android.content.Context;
 import android.text.format.DateFormat;
-import android.text.format.Time;
-
 
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
@@ -269,23 +267,4 @@
         }
         return anniversary.getTime();
     }
-
-    /**
-     * Determine the difference, in days between two dates.  Uses similar logic as the
-     * {@link android.text.format.DateUtils.getRelativeTimeSpanString} method.
-     *
-     * @param time Instance of time object to use for calculations.
-     * @param date1 First date to check.
-     * @param date2 Second date to check.
-     * @return The absolute difference in days between the two dates.
-     */
-    public static int getDayDifference(Time time, long date1, long date2) {
-        time.set(date1);
-        int startDay = Time.getJulianDay(date1, time.gmtoff);
-
-        time.set(date2);
-        int currentDay = Time.getJulianDay(date2, time.gmtoff);
-
-        return Math.abs(currentDay - startDay);
-    }
 }
diff --git a/tests/src/com/android/contacts/common/util/DateUtilTests.java b/tests/src/com/android/contacts/common/util/DateUtilTests.java
deleted file mode 100644
index f460289..0000000
--- a/tests/src/com/android/contacts/common/util/DateUtilTests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.contacts.common.util;
-
-import junit.framework.TestCase;
-
-import android.test.suitebuilder.annotation.SmallTest;
-import android.text.format.Time;
-
-/**
- * Unit tests for {@link com.android.contacts.common.util.DateUtils}.
- */
-@SmallTest
-public class DateUtilTests extends TestCase {
-
-    /**
-     * Test date differences which are in the same day.
-     */
-    public void testDayDiffNone() {
-        Time time = new Time();
-        long date1 = System.currentTimeMillis();
-        long date2 = System.currentTimeMillis() + android.text.format.DateUtils.HOUR_IN_MILLIS;
-        assertEquals(0, DateUtils.getDayDifference(time, date1, date2));
-        assertEquals(0, DateUtils.getDayDifference(time, date2, date1));
-    }
-
-    /**
-     * Test date differences which are a day apart.
-     */
-    public void testDayDiffOne() {
-        Time time = new Time();
-        long date1 = System.currentTimeMillis();
-        long date2 = date1 + android.text.format.DateUtils.DAY_IN_MILLIS;
-        assertEquals(1, DateUtils.getDayDifference(time, date1, date2));
-        assertEquals(1, DateUtils.getDayDifference(time, date2, date1));
-    }
-
-    /**
-     * Test date differences which are two days apart.
-     */
-    public void testDayDiffTwo() {
-        Time time = new Time();
-        long date1 = System.currentTimeMillis();
-        long date2 = date1 + 2*android.text.format.DateUtils.DAY_IN_MILLIS;
-        assertEquals(2, DateUtils.getDayDifference(time, date1, date2));
-        assertEquals(2, DateUtils.getDayDifference(time, date2, date1));
-    }
-}
