File tree 2 files changed +4
-10
lines changed
ethereum/statetransition/src
main/java/tech/pegasys/teku/statetransition/util
test/java/tech/pegasys/teku/statetransition/util
2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -164,14 +164,14 @@ String formatOptionalTimestamp(final Optional<UInt64> maybeTimestamp) {
164
164
165
165
@ VisibleForTesting
166
166
String formatTimestamp (final UInt64 arrivalTimestamp ) {
167
- final DateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss .SS" );
167
+ final DateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH_mm_ss .SS" );
168
168
final Date date = new Date (arrivalTimestamp .longValue ());
169
169
return df .format (date );
170
170
}
171
171
172
172
@ VisibleForTesting
173
173
String generateTimestamp (final TimeProvider timeProvider ) {
174
- final DateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss .SS" );
174
+ final DateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH_mm_ss .SS" );
175
175
final Date date = new Date (timeProvider .getTimeInMillis ().longValue ());
176
176
return df .format (date );
177
177
}
Original file line number Diff line number Diff line change @@ -165,20 +165,14 @@ void formatTimestamp_shouldFormatDate() {
165
165
final DebugDataDumper manager = new DebugDataDumper (Path .of ("." ), true );
166
166
final String formattedTimestamp =
167
167
manager .formatOptionalTimestamp (Optional .of (timeProvider .getTimeInMillis ()));
168
-
169
- final DateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SS" );
170
- final Date expectedDate = new Date (timeProvider .getTimeInMillis ().longValue ());
171
- assertThat (formattedTimestamp ).isEqualTo (df .format (expectedDate ));
168
+ assertThat (formattedTimestamp ).isEqualTo ("1970-01-01T12_46_40.00" );
172
169
}
173
170
174
171
@ Test
175
172
void generateTimestamp_shouldGenerateTimestamp () {
176
173
final DebugDataDumper manager = new DebugDataDumper (Path .of ("." ), true );
177
174
final String formattedTimestamp = manager .generateTimestamp (timeProvider );
178
-
179
- final DateFormat df = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SS" );
180
- final Date expectedDate = new Date (timeProvider .getTimeInMillis ().longValue ());
181
- assertThat (formattedTimestamp ).isEqualTo (df .format (expectedDate ));
175
+ assertThat (formattedTimestamp ).isEqualTo ("1970-01-01T12_46_40.00" );
182
176
}
183
177
184
178
private void checkBytesSavedToFile (final Path path , final Bytes expectedBytes ) {
You can’t perform that action at this time.
0 commit comments