java.time
With the java.time framework built into Java 8 and later (Tutorial) you can use TemporalAdjusters
to get next or previous day-of-week.
private LocalDate calcNextFriday(LocalDate d) {
return d.with(TemporalAdjusters.next(DayOfWeek.FRIDAY));
}
More Related Contents:
- Should I use Java date and time classes or go with a 3rd party library like Joda Time?
- How can I “pretty print” a Duration in Java?
- How to transform currentTimeMillis to a readable date format? [duplicate]
- GPS Time Representation library
- Java string to date conversion
- Calculating the difference between two Java date instances
- Is java.sql.Timestamp timezone specific?
- java.util.Date vs java.sql.Date
- What is this date format? 2011-08-12T20:17:46.384Z
- Convert timestamp in milliseconds to string formatted time in Java
- Java 8: Difference between two LocalDateTime in multiple units
- How to calculate elapsed time from now with Joda-Time?
- Number of days between two dates in Joda-Time
- Calendar returns date in wrong time zone
- How to subtract X day from a Date object in Java?
- System.currentTimeMillis() vs. new Date() vs. Calendar.getInstance().getTime()
- Get yesterday’s date using Date [duplicate]
- Differences between Java 8 Date Time API (java.time) and Joda-Time
- How to get start and end range from list of timestamps?
- Get integer value of the current year in Java
- How to round time to the nearest quarter hour in java?
- Convert java.time.Instant to java.sql.Timestamp without Zone offset
- Why were most java.util.Date methods deprecated?
- How to properly format the date?
- Parsing time strings like “1h 30min”
- Java Timestamp – How can I create a Timestamp with the date 23/09/2007?
- How do I get difference between two dates in android?, tried every thing and post
- Convert from java.util.date to JodaTime
- DateTimeParse Exception
- Getting Date in HTTP format in Java