DateFormat df = DateFormat.getInstance(); NumberFormat nf = NumberFormat.getInstance(); System.out.println(df.format(new Date())); System.out.println(nf.format(123.4567));