Skip to content

Commit

Permalink
Set snapshot timestamp to UTC.
Browse files Browse the repository at this point in the history
  • Loading branch information
alerosmile committed Jan 3, 2025
1 parent 98a7387 commit 268eab1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/vafer/jdeb/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ private static String formatSnapshotTemplate( String template, Date timestamp )
return template;
} else {
// prefix[yyMMdd]suffix
final String date = new SimpleDateFormat(template.substring(startBracket + 1, endBracket)).format(timestamp);
SimpleDateFormat dateFormat = new SimpleDateFormat(template.substring(startBracket + 1, endBracket));
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String datePrefix = startBracket == 0 ? "" : template.substring(0, startBracket);
String dateSuffix = endBracket == template.length() ? "" : template.substring(endBracket + 1);
return datePrefix + date + dateSuffix;
return datePrefix + dateFormat.format(timestamp) + dateSuffix;
}
}

Expand Down

0 comments on commit 268eab1

Please sign in to comment.