mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
ble+bt: use common time format for logging actions
This commit is contained in:
committed by
José Rebelo
parent
4536a0f42a
commit
7a30829bb6
@@ -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() {
|
||||
|
||||
+1
-6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user