Getting the time on the server

Discussion in 'Plugin Development' started by -_Husky_-, Jan 26, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    -_Husky_-

    Getting the time on the computer hosting the server??
     
  2. Offline

    w00tklumpWn

    Code:
    java.util.Date now = new Date();
    //now.getTime() returns the Unix-Timestamp.
     
    //format the output to "24-01-2012 15:19:45"
    SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
    System.out.println("Time: "+format.format(now));
     
    
    €dit: changed SimpleDateFormatter to SimpleDateFormat
     
  3. Offline

    -_Husky_-

    cheers
     
Thread Status:
Not open for further replies.

Share This Page