How can I get the current system time in JAva?
I have another thread in the Java forum, but for some reason this computer won't let me C&P the link... :confused:
Printable View
How can I get the current system time in JAva?
I have another thread in the Java forum, but for some reason this computer won't let me C&P the link... :confused:
There are a bunch of ways to format the current time in the java.util.Calendar class.
http://java.sun.com/j2se/1.3/docs/ap.../Calendar.html
:)
Whatever you do, don't use java.util.Date, virtually everything in that class has been deprecated since about JDK 1.1.
Yep. Ta. :)Quote:
Originally posted by filburt1
Whatever you do, don't use java.util.Date, virtually everything in that class has been deprecated since about JDK 1.1.
Got it sorted. I'm actually just modifying an old system for a Uni assignment, and it still uses all that old stuff - it was written 5-6 years ago. But I'm using the Calendar. :)
Hmmm... maybe I'll change the Date reference too...
If I use the Calender.getInstance() method, do I need to destroy it after I'm done, and how do I do this?
(My Java is beyond rusty, as you can see.... ;) )
You dont have to kill it.. The Java garbage collector will take care of it after awhile. Though Id recommend killing it when your done using it.
Ok, how do I kill stuff in Java, and more specifically, how do I kill this one, because it doesn't use the New keyword to instantiate, it has a .getInstance() function for that...
objectname=null;
Bacon Sandwich?Quote:
Originally posted by filburt1
Whatever you do, don't use java.util.Date, virtually everything in that class has been deprecated since about JDK 1.1.
U stole that!!!!Quote:
Originally posted by Bonker Gudd
Bacon Sandwich?