/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

import java.text.SimpleDateFormat ;

import java.time.* ;
import java.time.temporal.* ;
import java.time.format.* ;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String input = "2017/08/01 15:18:01" ;
		
		// Old outmoded way using troublesome legacy classes.
		SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		Date date = format.parse( input ) ;
		Calendar cal = Calendar.getInstance() ;
		cal.setTime( date ) ;
		System.out.println( "date.toString(): " + date  ) ;
		
		// New modern way in Java 8 and later.
		DateTimeFormatter f = DateTimeFormatter.ofPattern( "uuuu/MM/dd HH:mm:ss" , Locale.US ) ;
		LocalDateTime ldt = LocalDateTime.parse( input , f ) ;
		// If we assume this date-time was meant to be UTC.
		OffsetDateTime odt = ldt.atOffset( ZoneOffset.UTC ) ;
		System.out.println( "odt.toString(): " + odt ) ;
		
	}
}