Browse Source

Changed Format in Detection Report

bk_service
Bastian Kohler 11 months ago
parent
commit
39295f9780

+ 8
- 1
app/src/main/java/com/example/ueberwachungssystem/Detection/DetectionReport.java View File

@@ -1,8 +1,11 @@
package com.example.ueberwachungssystem.Detection;

import android.annotation.SuppressLint;
import android.util.Log;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/** Detection Report Class */
public class DetectionReport {
@@ -12,7 +15,11 @@ public class DetectionReport {
public boolean detectionState;

public DetectionReport(boolean detectionState, String detectionType, float detectedAmplitude) {
this.timeStamp = String.valueOf(Calendar.getInstance().getTime());
// New Date Format
@SuppressLint("SimpleDateFormat") SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
Date curDate = new Date(System.currentTimeMillis());
this.timeStamp = formatter.format(curDate);
//Old Date Format: this.timeStamp = String.valueOf(Calendar.getInstance().getTime());
this.detectionType = detectionType;
this.detectedValue = detectedAmplitude;
this.detectionState = detectionState;

Loading…
Cancel
Save