import java.time.LocalDate;
public class LocalDateExample {
public static void main(String[] args) {
// Creating a LocalDate instance for today's date
LocalDate today = LocalDate.now();
System.out.println("Today's Date: " + today);
// Adding days to the current date
LocalDate nextWeek = today.plusDays(7);
System.out.println("Date next week: " + nextWeek);
// Subtracting days from the current date
LocalDate yesterday = today.minusDays(1);
System.out.println("Yesterday's Date: " + yesterday);
// Formatting LocalDate
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MM-yyyy"));
System.out.println("Formatted Date: " + formattedDate);
}
}
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?