Introduction to Date Time API in Java 8

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

1. Introduction

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”

Java Calendar Examples

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

1. Introduction

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”

Using Timer Class to Schedule Tasks

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

1. Introduction

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”