mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-10 21:38:04 -05:00
Add Long.toDate() convenience method
This commit is contained in:
parent
0761faded4
commit
a9aa5d8ae1
@ -15,7 +15,10 @@ import java.nio.file.Files;
|
||||
import java.nio.file.attribute.BasicFileAttributeView;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.text.Normalizer;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.Temporal;
|
||||
import java.time.temporal.TemporalAmount;
|
||||
@ -519,6 +522,10 @@ public class ExpressionFormatMethods {
|
||||
return attr.lastModifiedTime().toMillis();
|
||||
}
|
||||
|
||||
public static LocalDateTime toDate(Long self) {
|
||||
return LocalDateTime.ofInstant(Instant.ofEpochMilli(self), ZoneOffset.systemDefault());
|
||||
}
|
||||
|
||||
public static File toFile(String self) {
|
||||
if (self == null || self.isEmpty()) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user