@ Nonnull public static WithZoneId extractDateTimeZone ( @ Nonnull final String sDate ) { ValueEnforcer . notNull ( sDate , "Date" ) ; final int nDateLen = sDate . length ( ) ; for ( final PDTZoneID aSupp : PDTZoneID . getDefaultZoneIDs ( ) ) { final String sDTZ = aSupp . getZoneIDString ( ) ; if ( sDate . endsWith ( " " + sDTZ ) ) return new WithZoneId ( sDate . substring ( 0 , nDateLen - ( 1 + sDTZ . length ( ) ) ) , aSupp . getZoneID ( ) ) ; if ( sDate . endsWith ( sDTZ ) ) return new WithZoneId ( sDate . substring ( 0 , nDateLen - sDTZ . length ( ) ) , aSupp . getZoneID ( ) ) ; } return new WithZoneId ( sDate , null ) ; }
Extract the time zone from the passed string . UTC and GMT are supported .