2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-25 08:17:11 -07:00

Truncate jmod ISO date to seconds

This commit is contained in:
Erik C. Thauvin 2024-08-05 10:25:41 -07:00
parent d42d2d6fa0
commit d72e6ebc2e
Signed by: erik
GPG key ID: 776702A6A2DA330E
2 changed files with 3 additions and 2 deletions

View file

@ -6,6 +6,7 @@ package rife.bld.operations;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
@ -74,7 +75,7 @@ public class JmodOptions extends HashMap<String, String> {
* @return this map of options
*/
public JmodOptions date(ZonedDateTime date) {
put("--date", date.format(DateTimeFormatter.ISO_INSTANT));
put("--date", date.truncatedTo(ChronoUnit.SECONDS).format(DateTimeFormatter.ISO_INSTANT));
return this;
}

View file

@ -56,7 +56,7 @@ public class TestJmodOperation {
.classpath(args.get("--class-path"))
.cmds(args.get("--cmds"))
.config(args.get("--config"))
.date(ZonedDateTime.of(1997, 8, 29, 2, 14, 0, 0, ZoneId.of("America/Los_Angeles")))
.date(ZonedDateTime.of(1997, 8, 29, 2, 14, 0, 1, ZoneId.of("America/Los_Angeles")))
.dir(args.get("--dir"))
.doNotResolveByDefault(true)
.dryRun(true)