0% found this document useful (0 votes)
4 views

Local Date Time

Local date time questions based in java 8

Uploaded by

ANKIT SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Local Date Time

Local date time questions based in java 8

Uploaded by

ANKIT SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

java 8 LocalDateTime API

1) Write a java program to find the current date in DD-MM-YYYY format.


2) Write a java program to find whether the current year is a leap year.
3) Write a java program to create a Localdate object for today's date, and then
print the day, month and year separately
4) Write a program that takes a birthdate (eq 1994-11-31) and calculates the exact
age in year, months and days using Period.
5) Convert the date and time from default zone to another time zone (eg :
America/New York)
6) Write a java program that formats the current LocalDateTime into the format dd-
MM-yyyy HH:mm:ss using dateTimeFormatter.
7) Write a java program that takes date in string format (eg: "2024-10-04") and
parse this stringinto a LocalDate object and print the day of week.
8) Write a java program that takes todays date and calculate thedate of next
Tuesday.
9) Write a java program to calculate the Duratiohn between two LocalTime objects(eg
: between 12:30 and 15:00)
10) Write a java program that list all Mondays in a given month.

You might also like