Browse Source

Changed Format in Detection Report

bk_service
Bastian Kohler 1 year ago
parent
commit
39295f9780

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

package com.example.ueberwachungssystem.Detection; package com.example.ueberwachungssystem.Detection;


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


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


/** Detection Report Class */ /** Detection Report Class */
public class DetectionReport { public class DetectionReport {
public boolean detectionState; public boolean detectionState;


public DetectionReport(boolean detectionState, String detectionType, float detectedAmplitude) { 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.detectionType = detectionType;
this.detectedValue = detectedAmplitude; this.detectedValue = detectedAmplitude;
this.detectionState = detectionState; this.detectionState = detectionState;

Loading…
Cancel
Save