public static TimeZone getStockTimeZone ( String symbol ) { // First check if it's a known stock index if ( INDEX_TIMEZONES . containsKey ( symbol ) ) { return INDEX_TIMEZONES . get ( symbol ) ; } if ( ! symbol . contains ( "." ) ) { return ExchangeTimeZone . get ( "" ) ; } String [ ] split = symbol . split ( "\\." ) ; return ExchangeTimeZone . get ( split [ split . length - 1 ] ) ; }
Get the time zone for a specific stock or index . For stocks the exchange suffix is extracted from the stock symbol to retrieve the time zone .