static void main ( String [ ] argv ) { Time time = null ; TimeFormat in = null ; TimeFormat out = null ; if ( argv . length >= 3 ) { System . out . println ( "Creating out TimeFormat: \"" + argv [ 2 ] + "\"" ) ; out = new TimeFormat ( argv [ 2 ] ) ; } if ( argv . length >= 2 ) { System . out . println ( "Creating in TimeFormat: \"" + argv [ 1 ] + "\"" ) ; in = new TimeFormat ( argv [ 1 ] ) ; } else { System . out . println ( "Using default format for in" ) ; in = DEFAULT_FORMAT ; } if ( out == null ) out = in ; if ( argv . length >= 1 ) { System . out . println ( "Parsing: \"" + argv [ 0 ] + "\" with format \"" + in . formatString + "\"" ) ; time = in . parse ( argv [ 0 ] ) ; } else time = new Time ( ) ; System . out . println ( "Time is \"" + out . format ( time ) + "\" according to format \"" + out . formatString + "\"" ) ; }
Main method for testing ONLY