Skip to content

Commit

Permalink
choose a better date format when exporting files as xml
Browse files Browse the repository at this point in the history
  • Loading branch information
SavvasMisaghMoayyed committed Jun 22, 2018
1 parent b17b639 commit 11aeba3
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -29,6 +29,9 @@
import org.apache.wicket.util.file.Files;

import java.io.*;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Collection;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
Expand Down Expand Up @@ -99,7 +102,8 @@ protected File initFile() {
}

String suffix = isUseZip() ? "zip" : "xml";
String fileName = "ExportedData_" + getType().getSimpleName() + "_" + System.currentTimeMillis() + "." + suffix;
String currentTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy_MM_dd_HH_m_s"));
String fileName = "ExportedData_" + getType().getSimpleName() + "_" + currentTime + "." + suffix;
File file = new File(folder, fileName);

Writer writer = null;
Expand Down

0 comments on commit 11aeba3

Please sign in to comment.