william007
asked on
How to convert datetime to long value?
I wish to use the timestamp class, as the first method is deprecated, I wish to use the second one. What is the common way to convert the year, month, date, hour, minute, second, and nano to a long value?
Timestamp(int year, int month, int date, int hour, int minute, int second, int nano)
Deprecated. instead use the constructor Timestamp(long millis)
Timestamp(long time)
Constructs a Timestamp object using a milliseconds time value.
Timestamp(int year, int month, int date, int hour, int minute, int second, int nano)
Deprecated. instead use the constructor Timestamp(long millis)
Timestamp(long time)
Constructs a Timestamp object using a milliseconds time value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See http://java.sun.com/j2se/1.5.0/docs/api/java/util/GregorianCalendar.html#GregorianCalendar()
and its other ctors
and its other ctors
ASKER
Hi, I just miss it, the calendar class has a method
set(int year, int month, int date, int hourOfDay, int minute, int second)
Thanks:-)
set(int year, int month, int date, int hourOfDay, int minute, int second)
Thanks:-)
:-)
ASKER