Changed Format in Detection Report

This commit is contained in:
Bastian Kohler 2023-06-21 09:49:45 +02:00
parent 54ba3b4862
commit 39295f9780

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;