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

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

import java.time.*;

/* 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
	{

        LocalDate localDate = LocalDate.parse( "2016-12-28" );
        ZoneId zNewYork = ZoneId.of( "America/New_York" );
        ZonedDateTime zdtNewYork = localDate.atStartOfDay( zNewYork );       // First moment of the day in that zone on that date.

        Instant instant = zdtNewYork.toInstant();
        
        System.out.println( "localDate.toString(): " + localDate );
        System.out.println( "zdtNewYork.toString(): " + zdtNewYork );
        System.out.println( "instant.toString(): " + instant );
        System.out.println( "-------------------------------" );

        List < ZoneId > hits = new ArrayList <>();
        LocalDate originalLocalDate = null;
        Set < String > zoneIds = ZoneId.getAvailableZoneIds();  // Gets the set of available zone IDs.
        for ( String zoneId : zoneIds )
        {
            ZoneId z = ZoneId.of( zoneId );                        // Get zone with that name.
            ZonedDateTime zdt = instant.atZone( z );
            LocalDate ld = zdt.toLocalDate();                      // Extract the date-only value, dropping the time-of-day and dropping the time zone.
            ZonedDateTime startOfDay = ld.atStartOfDay( z );       // Determine first moment of the day on that date in that zone.
            Instant instantOfStartOfDay = startOfDay.toInstant();  // Adjust back to UTC.
            boolean hit = instant.equals( instantOfStartOfDay );
            if ( hit )
            {
                originalLocalDate = ld;
                hits.add( z );  // Collect this time zone as the zone possibly used originally.
            }
        }

        System.out.println( "originalLocalDate.toString(): " + originalLocalDate );
        System.out.println( "hits.toString(): " + hits );
        
	}
}