Results 1 to 9 of 9

Thread: Have a Java Q...

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Question Have a Java Q...

    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...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Whatever you do, don't use java.util.Date, virtually everything in that class has been deprecated since about JDK 1.1.

  4. #4

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    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.
    Yep. Ta.

    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.... )
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  5. #5
    joan_fl
    Guest
    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.

  6. #6

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    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...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  7. #7
    joan_fl
    Guest
    objectname=null;

  8. #8
    Fanatic Member Bonker Gudd's Avatar
    Join Date
    Mar 2000
    Location
    Saturn
    Posts
    748
    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.
    Bacon Sandwich?

  9. #9
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    Originally posted by Bonker Gudd
    Bacon Sandwich?
    U stole that!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width