| Free tutorials for Java, Eclipse and Web programming |
Version 0.3
Copyright © 2009 - 2010 Lars Vogel
26.03.2010
| Revision History | ||
|---|---|---|
| Revision 0.1 | 01.05.2009 | Lars Vogel |
| First Version | ||
| Revision 0.2 | 05.02.2010 | Lars Vogel |
| Typo fixed | ||
| Revision 0.3 | 26.03.2010 | Lars Vogel |
| how to format the output format of date | ||
Table of Contents
The Java language provides direct support for time based objects. This article gives a few examples how this API can be used. .
The class java.util.Date was the first implementation which was used for manipulating dates. The class java.util.Calendar was added in Java 1.1 and provides simplified access to storing and manipulating dates.
It is recommended to use Calendar if possible. In reality you have to convert frequently from Date to Calendar and vice versa, e.g. during database access you often get a java.sql.Date object. The following explains how to use Calendar and how to convert Dates into Calendar.