diff --git a/core/java/android/os/SystemClock.java b/core/java/android/os/SystemClock.java
index 7379443..d03a87d 100644
--- a/core/java/android/os/SystemClock.java
+++ b/core/java/android/os/SystemClock.java
@@ -352,7 +352,7 @@
                 }
                 long currentNanos = elapsedRealtimeNanos();
                 long deltaMs = (currentNanos - time.getElapsedRealtimeNanos()) / 1000000L;
-                return time.getTime() + deltaMs;
+                return time.getUnixEpochTimeMillis() + deltaMs;
             }
         };
     }
diff --git a/location/java/android/location/LocationTime.java b/location/java/android/location/LocationTime.java
index e5535d1..2f03508 100644
--- a/location/java/android/location/LocationTime.java
+++ b/location/java/android/location/LocationTime.java
@@ -20,28 +20,32 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
+import java.time.Duration;
+import java.time.Instant;
+
 /**
- * Data class for passing location derived time.
+ * Data class for passing GNSS-derived time.
  * @hide
  */
 public final class LocationTime implements Parcelable {
 
-    private final long mTime;
+    private final long mUnixEpochTimeMillis;
     private final long mElapsedRealtimeNanos;
 
-    public LocationTime(long time, long elapsedRealtimeNanos) {
-        mTime = time;
+    public LocationTime(long unixEpochTimeMillis, long elapsedRealtimeNanos) {
+        mUnixEpochTimeMillis = unixEpochTimeMillis;
         mElapsedRealtimeNanos = elapsedRealtimeNanos;
     }
 
     /**
-     * The current time, according to the Gnss location provider. */
-    public long getTime() {
-        return mTime;
+     * The Unix epoch time in millis, according to the Gnss location provider.
+     */
+    public long getUnixEpochTimeMillis() {
+        return mUnixEpochTimeMillis;
     }
 
     /**
-     * The elapsed nanos since boot {@link #getTime} was computed at.
+     * The elapsed nanos since boot when {@link #getUnixEpochTimeMillis} was the current time.
      */
     public long getElapsedRealtimeNanos() {
         return mElapsedRealtimeNanos;
@@ -49,7 +53,7 @@
 
     @Override
     public void writeToParcel(Parcel out, int flags) {
-        out.writeLong(mTime);
+        out.writeLong(mUnixEpochTimeMillis);
         out.writeLong(mElapsedRealtimeNanos);
     }
 
@@ -58,8 +62,18 @@
         return 0;
     }
 
+    @Override
+    public String toString() {
+        return "LocationTime{"
+                + "mUnixEpochTimeMillis=" + Instant.ofEpochMilli(mUnixEpochTimeMillis)
+                + "(" + mUnixEpochTimeMillis + ")"
+                + ", mElapsedRealtimeNanos=" + Duration.ofNanos(mElapsedRealtimeNanos)
+                + "(" + mElapsedRealtimeNanos + ")"
+                + '}';
+    }
+
     public static final @NonNull Parcelable.Creator<LocationTime> CREATOR =
-            new Parcelable.Creator<LocationTime>() {
+            new Parcelable.Creator<>() {
                 public LocationTime createFromParcel(Parcel in) {
                     long time = in.readLong();
                     long elapsedRealtimeNanos = in.readLong();
diff --git a/services/core/java/com/android/server/timedetector/GnssTimeUpdateService.java b/services/core/java/com/android/server/timedetector/GnssTimeUpdateService.java
index 5db6000..6949191 100644
--- a/services/core/java/com/android/server/timedetector/GnssTimeUpdateService.java
+++ b/services/core/java/com/android/server/timedetector/GnssTimeUpdateService.java
@@ -261,10 +261,11 @@
     private void suggestGnssTime(LocationTime locationTime) {
         logDebug("suggestGnssTime()");
 
-        long gnssTime = locationTime.getTime();
+        long gnssUnixEpochTimeMillis = locationTime.getUnixEpochTimeMillis();
         long elapsedRealtimeMs = locationTime.getElapsedRealtimeNanos() / 1_000_000L;
 
-        TimestampedValue<Long> timeSignal = new TimestampedValue<>(elapsedRealtimeMs, gnssTime);
+        TimestampedValue<Long> timeSignal =
+                new TimestampedValue<>(elapsedRealtimeMs, gnssUnixEpochTimeMillis);
         mLastSuggestedGnssTime = timeSignal;
 
         GnssTimeSuggestion timeSuggestion = new GnssTimeSuggestion(timeSignal);
