Es.:
codice:Date d = new Date(); // data corrente System.out.println(d.getTime()); // es. 1452723016087 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSZ", Locale.ENGLISH); System.out.println(sdf.format(d)); // es. 2016-01-13 23:10:16.087+0100
I (Simple)DateFormat hanno anche i parse(String). La documentazione javadoc ufficiale chiarisce tutti i dettagli.![]()