Package com.sk89q.worldedit.util.time
Class FileNameDateTimeParser
java.lang.Object
com.sk89q.worldedit.util.time.FileNameDateTimeParser
- All Implemented Interfaces:
SnapshotDateTimeParser
Parses date-times by looking at the file name. File names without a time
will use 00:00:00.
Elements may be separated by a space, dash, or colon. The date and time may additionally be separated by a 'T'. Only the year must have all digits, others may omit padding zeroes.
Valid file name examples:
2019-06-15
2019-06-15 10:20:30
2019-06-15 10:20:30
2019-06-15T10:20:30
2019 06 15 10 20 30
2019-06-15-10-20-30
2019-6-1-1-2-3
-
Method Summary
Modifier and TypeMethodDescriptiondetectDateTime
(Path path) Attempt to detect an ZonedDateTime from a path.static FileNameDateTimeParser
-
Method Details
-
getInstance
-
detectDateTime
Description copied from interface:SnapshotDateTimeParser
Attempt to detect an ZonedDateTime from a path.The path is not guaranteed to exist.
- Specified by:
detectDateTime
in interfaceSnapshotDateTimeParser
- Parameters:
path
- the path- Returns:
- date-time, if it can be parsed
-