O'Reilly logo

Java Garage by Eben Hewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dates

In this topic, I will just present a few classes that do a lot of different things with dates. You can see what kinds of classes, methods, and fields are available to you, and hopefully you can just copy and paste methods here with little modification into your own projects.

Dates.java

 package net.dates; import java.util.*; import java.text.*; /** This class contains a number of useful methods that make it convenient to do common operations involving dates. It uses java.util.Calendar and java.util.GregorianCalendar to do so. <p> Hopefully you can paste this directly into your own utilities library. <p> Just modify the classes to accept calendar objects and return the int values. I didn't do this here so that it would make the code easier ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required