English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi

I need the data type for date and its import statement. Can you find out and tell me please.

2006-11-15 05:02:34 · 1 answers · asked by Madhan 1 in Computers & Internet Programming & Design

1 answers

Just a "simple" date? java.util.Date is used to represent a point in time as measured from Java's epoch, midnight, Jan 1, 1970 (same as C).

Import examples:
import java.util.Date;
import java.util.*;

If working with databases through JDBC, then you will probably need to use the subclass of java.util.Date called java.sql.Date.

If you need to do more complex date representation, for example, you need to move from some time today to sometime tomorrow, then use Calendar & GregorianCalendar (no, simpling adding the milliseconds for 24 hours is NOT right!).

2006-11-15 09:13:28 · answer #1 · answered by vincentgl 5 · 0 0

fedest.com, questions and answers