Sascha's Wiki

Einfacher Timestamp

import java.sql.Timestamp;
import java.util.Date;

public class GetCurrentTimeStamp {

    public static void main(String[] args) {

        Date      date      = new Date();
        long      time      = date.getTime();
        Timestamp stamp     = new Timestamp(time);
        String    timestamp = stamp.toString();
        
        System.out.println(timestamp);

    }

}

java/allgemein/timestamp.txt · Zuletzt geändert: 2016/04/21 09:15 (Externe Bearbeitung)