Time & Date

i want to get the time & the date from the systemcan any one help me ?
[88 byte] By [TheInsider] at [2007-9-30 20:38:18]
# 1
new Date()/k1
komone at 2007-7-7 1:27:32 > top of Java-index,Administration Tools,Sun Connection...
# 2

new Date() works fine, might be because of the reason that it is written by James Gosling :)

If you need time in 'long' format, as sometimes you stores time in DB as 'long' to retrieve it next time, then you can use System.currentTimeMillis(). It returns current time (and internally Date() uses it). It saves the time in creating an object of Date(), secondly, it saves time in getting millis from Date object, thirdly the Date class uses Calendar class to do the computations, so the calls to the Date object goes to Calendar object.

Regards,

First_INTELLIGENT_Scientist at 2007-7-7 1:27:32 > top of Java-index,Administration Tools,Sun Connection...