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

import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.* ;
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
	{
		System.out.println( Runtime.version() ) ;
		
		Ideone.demo( "2022-12-29 01:16:03 GMT+08:00" ) ;  // Succeeds.
		Ideone.demo( "2022-12-29 01:16:03 UTC+08:00" ) ;  // Fails.
	}
	
	private static void demo( String timeStr ) 
	{
		DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss O");
		ZonedDateTime zonedDateTime = ZonedDateTime.parse(timeStr, dtf);
		System.out.println( zonedDateTime ) ;
	}
}