Compatible Windows
":" can not write to file name if the system is windows
This commit is contained in:
parent
2d0e9af3a9
commit
1e698b9400
@ -99,6 +99,11 @@ public class BackupHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static DateTimeFormatter getDateTimeFormatter(){
|
public static DateTimeFormatter getDateTimeFormatter(){
|
||||||
return DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm:ss");
|
String os = System.getProperty("os.name");
|
||||||
|
if (os.toLowerCase().startsWith("win")) {
|
||||||
|
return DateTimeFormatter.ofPattern("dd.MM.yyyy_HH-mm-ss");
|
||||||
|
} else {
|
||||||
|
return DateTimeFormatter.ofPattern("dd.MM.yyyy_HH:mm:ss");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user