File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
core/src/main/java/edu/wpi/grip/core/operations/composite Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1313import org .bytedeco .javacpp .BytePointer ;
1414import org .bytedeco .javacpp .IntPointer ;
1515
16- import java .text . SimpleDateFormat ;
17- import java .util . Date ;
16+ import java .time . LocalDateTime ;
17+ import java .time . format . DateTimeFormatter ;
1818import java .util .List ;
1919import java .util .concurrent .TimeUnit ;
2020
@@ -51,8 +51,8 @@ public class SaveImageOperation implements Operation {
5151
5252 private final FileManager fileManager ;
5353 private final BytePointer imagePointer = new BytePointer ();
54- private Stopwatch stopwatch = Stopwatch .createStarted ();
55- private SimpleDateFormat format = new SimpleDateFormat ( "yyyyMMdd_HHmmss.SSS " );
54+ private final Stopwatch stopwatch = Stopwatch .createStarted ();
55+ private final DateTimeFormatter formatter = DateTimeFormatter . ofPattern ( "yyyyMMddHHmmssSSS " );
5656
5757 public SaveImageOperation (InputSocket .Factory inputSocketFactory , OutputSocket .Factory outputSocketFactory , FileManager fileManager ) {
5858 this .fileManager = fileManager ;
@@ -104,6 +104,6 @@ public void perform() {
104104 }
105105 imagePointer .get (buffer , 0 , bufferSize );
106106
107- fileManager .saveImage (buffer , format . format ( new Date () ) + ".jpeg" );
107+ fileManager .saveImage (buffer , LocalDateTime . now (). format ( formatter ) + ".jpeg" );
108108 }
109109}
You can’t perform that action at this time.
0 commit comments