Work with time and date using the date-time API, new in java 8.
“Never tell the truth to people who are not worthy of it.”
― Mark Twain
Java 8 provides a new package for date, time and calendar calculations as an improvement over the earlier Date and Calendar classes. This is called the Date-Time API. Let us learn how to use this API.
Continue reading “Introduction to Date Time API in Java 8”
A Tutorial covering the basics of Java Calendar and Date Manipulation
“Let us tenderly and kindly cherish therefore, the means of knowledge. Let us dare to read, think, speak, and write .”
― John Adams
Java provides a Calendar class for performing data manipulation. A closely related class is the Date class, used to represent a specific instant in time starting from epoch (January 1, 1970 00:00:00.000 GMT). Let use learn how we can use these two classes for date and time manipulation.
Continue reading “Java Calendar Examples”
Learn how to use the Timer and the TimerTask classes to implement simple task scheduling for your application.
“Humor is reason gone mad.”
― Groucho Marx
Scheduling tasks to run is a need which sometimes arises in a java program. Maybe you want to run periodic cleanup of some resource. Or check on the status of some job. Or maybe fetch a URL which might not be available the first time.
Continue reading “Using Timer Class to Schedule Tasks”
We can parse and format dates in Java easily with the SimpleDateFormat class. It is similar to using the POSIX function strftime() in C/C++ with a few gotchas. Let us learn the proper usage of SimpleDateFormat and delve into some of its issues.
Continue reading “Java SimpleDateFormat Guide”