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

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

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

/* 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
	{
		// Specify the moment of launch as seen in Rome.
	    LocalDate launchDateAsSeenInRome = LocalDate.of( 2021 , 1 , 23 ) ;
	    LocalTime launchTimeAsSeenInRome = LocalTime.of( 21 , 0 ) ;
	    ZoneId zoneEuropeRome = ZoneId.of( "Europe/Rome" ) ;
	    ZonedDateTime launchMomentAsSeenInRome = ZonedDateTime.of( launchDateAsSeenInRome , launchTimeAsSeenInRome , zoneEuropeRome ) ;

		System.out.println( "launchMomentAsSeenInRome.toString(): " + launchMomentAsSeenInRome ) ;
		
		// Adjust from Rome time zone to UTC.
		Instant launchInstant = launchMomentAsSeenInRome.toInstant() ;  
		
		System.out.println( "launchInstant.toString(): " + launchInstant ) ;
		
		// Convert to `OffsetDateTime` object for use with standard JDBC 4.2.
		OffsetDateTime odtLaunchAsSeenInRome = launchMomentAsSeenInRome.toOffsetDateTime() ;
		
		// Adjust to some other time zone.
		ZoneId zoneAmericaNewYork = ZoneId.of( "America/New_York" ) ;
		ZonedDateTime launchAsSeenInNewYork = odtLaunchAsSeenInRome.atZoneSameInstant( zoneAmericaNewYork ) ;

		System.out.println( "launchAsSeenInNewYork.toString(): " + launchAsSeenInNewYork ) ; 
		

	}
}