How to know whether a country is using Daylight Saving Time using JavaScript?
问题 I'm in China and I've a friend who is in other countries. e.g. UK, USA, New Zealand... I know his country's name in English and time zone there. But how can I know whether his country is using DST now or not? Any ideas? Thank you! 回答1: Here is an example using JSONP and some Yahoo services: function jsonp(src){ var s = document.createElement('script'); s.charset = 'UTF-8'; document.body.appendChild(s); s.src = src; } function getLocation(where){ var src = 'http://query.yahooapis.com/v1/public