Localizing the Stock Quotes
When you are using the YFaPi library you may wonder How do I get the trade timestamps returned in my own Time Zone? If so you are in luck as Yahoo Finance has localize their site for different countries and as such we can query the appropriate localization to get your timestamps.
To enable localization you simply need to set the local property.
$api->local = YahooFinance_Location::SINGAPORE;
The YahooFinance_Location class contains constants for the different localizations support by Yahoo Finance. For easy reference I have included the full list below.
| Country | URL Prefix |
|---|---|
| Argentina | ar |
| Australia | au |
| Brazil | br |
| Canada | ca |
| France | fr |
| Germany | de |
| Hong Kong | hk |
| India | in |
| Ireland | uk |
| Italy | it |
| Korea | kr |
| New Zealand | au |
| Singapore | sg |
| Spain | es |
| United Kingdom | uk |