import java.text.*; ... /* - value for conversion */ String s = "20.10.2017"; /* - specify format mask */ DateFormat df = new SimpleDateFormat( "dd.MM.yyyy" ); try { /* - try to convert */ Date d = df.parse( s ); /* - print result */ System.out.println( df.format( d ) ); } catch ( ParseException ex ) {}Output:
20.10.2017
No comments:
Post a Comment