Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "2017-02-12 06:59:00 +1300"
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss ZZ");
- this.actionTime = dateTimeFormatter.parse(actionTime, ZonedDateTime::from);
- public DateCalculatorTest(String actionTime, int expectedDayOfWeek) {
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss ZZ");
- DateTimeFormatter localTimeFormatter = DateTimeFormatter.ofPattern("YYYY-MM-dd");
- this.actionTime= dateTimeFormatter.parse(actionTime, ZonedDateTime::from);
- this.expectedDayOfWeek= expectedDayOfWeek;
- }
- Text '2017-02-12 06:59:00 +1300' could not be parsed: Unable to obtain ZonedDateTime from TemporalAccessor: {WeekBasedYear[WeekFields[SUNDAY,1]]=2017, DayOfMonth=12, MonthOfYear=2, OffsetSeconds=46800},ISO resolved to 06:59 of type java.time.format.Parsed
- YYYY-MM-dd HH:mm:ss ZZ
- yyyy-MM-dd HH:mm:ss ZZ
- this.actionTime = ZonedDateTime.parse(actionTime, dateTimeFormatter.withZone(ZoneId.of(<<yourxoneid>>)));
Add Comment
Please, Sign In to add comment