Top 40 Data and Time Questions in Java



Hello friends, check out top 40 date and time questions with their solutions in Java. The solution of every question is very simple and straightforward.

Top 40 date and time questions in Java
Top 40 date and time questions/answers in Java


1. How to print current date and time ? - Solution

2. How to check whether given date is valid or not ? - Solution

3. How to compare two given dates ? - Solution

4. How to convert given Date to String ? - Solution

5. How to convert given String to Date ? - Solution

6. How to get time zone information ? - Solution

7. How to change time zone?  - Solution

8. How to display month name in different formats ? - Solution

9. How to display day name in different formats ? - Solution

10. How to display time in 12 and 24 hour format ? - Solution

11. How to convert Calendar to Date ? - Solution

12. How to convert given Date to Calendar ? - Solution

13. How to find month name from given date ? - Solution

14. How to find day name from given date ? - Solution

15. How to find all the information about given date ? - Solution

16. How to find number of days between two given dates ? - Solution

17. How to find number of weeks between two given dates ? - Solution

18. How to find number of months between two given dates ? - Solution

19. How to convert given Date to LocalDate ? - Solution

20. How to convert LocalDate to Date ? - Solution

21. How to check whether given year is leap year or not ? - Solution

22. How to convert given Date to LocalDateTime ? - Solution

23. How to convert LocalDateTime to Date ? - Solution

24. How to convert given Date to ZonedDateTime ? - Solution

25. How to convert ZonedDateTime to Date ? - Solution

26. How to calculate age in years, months and days ? - Solution

27. How to find all the leap years between two given years ? - Solution

28. How to add years, months, weeks and days in given date ? - Solution

29. How to subtract years, months, weeks and days from given date ? - Solution

30. How to add N working days to the current date ? - Solution

31. How to add two given times in HH:mm:ss format ? - Solution

32. How to subtract N working days from current date ? - Solution

33. How to subtract two given times in HH:mm:ss format ? - Solution

34. How to find number of days and weeks in given month ? - Solution

35. How to find working and non-working days in given month and year ? - Solution

36. How to find day before N years ? - Solution

37. How to find day after N years ? - Solution

38. What is the date on Monday in current week ? - Solution

39. How to check whether given date occurred on Friday the 13th ? - Solution

40. How to find all Mondays in given month and year ? - Solution

Note : If you have any other question please feel free to comment below or Contact Us.

Thank you friends, I hope you understood all the solutions. If you have any doubt, suggestion or query please feel free to comment below. You can also discuss all the questions in our forum.

About Author:

I am simple guy with lot of ambitions. My main motive is to share whatever knowledge I have related to programming. With me you can easily learn how to solve any programming problem in Java.You can connect with me on social networking sites also.


Let's Get Connected: Linkedin | Facebook |

Top 40 Data and Time Questions in Java Top 40 Data and Time Questions in Java Reviewed by Rohit Agarwal on 3/21/2017 Rating: 5

No comments:

Please provide your valuable comments. If you have any suggestion please share with me I will work on it and if you have any question or doubt please ask, don't hesitate. I am your friend, i will clarify all your doubts.

Powered by Blogger.