use DateTime instead of Calendar

This commit is contained in:
Milos Kozak 2021-02-24 09:49:02 +01:00
parent 699b4269cc
commit 2fc3799153
2 changed files with 7 additions and 6 deletions

View file

@ -100,6 +100,7 @@ def allCommitted = { ->
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "skipped", "started"]
// testLogging.events = ["failed", "skipped", "started", "standard_out"] use to display stdout in travis
testLogging.exceptionFormat = "full"
}

View file

@ -139,12 +139,12 @@ public class DateUtil {
hours -= 12;
if ((m.group(3).equals(" p.m.") || m.group(3).equals(" PM") || m.group(3).equals("PM")) && !(m.group(1).equals("12")))
hours += 12;
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, hours);
c.set(Calendar.MINUTE, minutes);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
retval = c.getTimeInMillis();
DateTime t = new DateTime()
.withHourOfDay(hours)
.withMinuteOfHour(minutes)
.withSecondOfMinute(0)
.withMillisOfSecond(0);
retval = t.getMillis();
}
return retval;
}