ble+bt: use common time format for logging actions

This commit is contained in:
Thomas Kuehne
2025-07-27 22:00:50 +02:00
committed by José Rebelo
parent 4536a0f42a
commit 7a30829bb6
3 changed files with 2 additions and 10 deletions
@@ -18,8 +18,6 @@ package nodomain.freeyourgadget.gadgetbridge.service.btbr;
import android.bluetooth.BluetoothSocket;
import java.util.Date;
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
/**
@@ -55,7 +53,7 @@ public abstract class BtBRAction {
public abstract boolean run(BluetoothSocket socket);
protected String getCreationTime() {
return DateTimeUtils.formatDateTime(new Date(creationTimestamp));
return DateTimeUtils.formatLocalTime(creationTimestamp);
}
public String toString() {
@@ -17,12 +17,7 @@
package nodomain.freeyourgadget.gadgetbridge.service.btle;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattServer;
import android.bluetooth.BluetoothGattService;
import java.util.Date;
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
@@ -66,7 +61,7 @@ public abstract class BtLEServerAction {
protected String getCreationTime() {
return DateTimeUtils.formatDateTime(new Date(creationTimestamp));
return DateTimeUtils.formatLocalTime(creationTimestamp);
}
public String toString() {
@@ -328,7 +328,6 @@ public class DateTimeUtils {
return fromFormattedDate + " - " + toFormattedDate;
}
private static SimpleDateFormat mFormatLocalTime;
/// format UTC millisecond epoch as local time (e.g. 23:59:59)
public static String formatLocalTime(long epochMilli) {
Date date = new Date(epochMilli);