PHP retrieves the current server time (China)

Source: Internet
Author: User
Tags echo date time zones

<? PHP
// If php> 5.1.0
If (phpversion ()> = '5. 1.0 ')
{
/// Obtain the current time zone of PHP
// Echo date_default_timezone_get ();
// Set the time zone
Date_default_timezone_set ('Asia/Shanghai ');
}
Echo date ('Y-m-d h: I: s', time ());
?>

PHP manual --- appendix I. List of supported time zones in AsiaTable I .5. Asia

Asia/Aden Asia/Almaty Asia/Amman Asia/ANADYR Asia/Aqtau
Asia/Aqtobe Asia/Ashgabat Asia/Ashkhabad Asia/Baghdad Asia/Bahrain
Asia/Baku Asia/Bangkok Asia/Beirut Asia/Bishkek Asia/Brunei
Asia/Calcutta Asia/choibalsan Asia/Chongqing Asia/Chungking Asia/Colombo
Asia/Dacca Asia/Damascus Asia/Dhaka Asia/Dili Asia/Dubai
Asia/Dushanbe Asia/Gaza Asia/Harbin Asia/hong_kong Asia/hovd
Asia/Irkutsk Asia/Istanbul Asia/Jakarta Asia/Jayapura Asia/Jerusalem
Asia/Kabul Asia/Kamchatka Asia/Karachi Asia/Kashgar Asia/Katmandu
Asia/quernoyarsk Asia/kuala_lumpur Asia/Kuching Asia/Kuwait Asia/Macao
Asia/Macau Asia/Magadan Asia/Makassar Asia/Manila Asia/Muscat
Asia/nicsia Asia/Novosibirsk Asia/Omsk Asia/oral Asia/phnom_penh
Asia/Pontianak Asia/Pyongyang Asia/Qatar Asia/Qyzylorda Asia/Rangoon
Asia/Riyadh Asia/Saigon Asia/sahalin Asia/Samarkand Asia/Seoul
Asia/Shanghai Asia/Singapore Asia/Taipei Asia/Tashkent Asia/Tbilisi
Asia/Tehran Asia/tel_aviv Asia/thimbu Asia/Thimphu Asia/Tokyo
Asia/ujung_pandang Asia/Ulaanbaatar Asia/ulan_bator Asia/Urumqi Asia/Vientiane
Asia/Hangzhou Vostok Asia/Yakutsk Asia/Yekaterinburg Asia/Yerevan Indian/Antananarivo
Indian/Chagos Indian/Christmas Indian/cocos Indian/Comoro Indian/Kerguelen
Indian/Mahe Indian/Maldives Indian/Mauritius Indian/Mayotte Indian/reunion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.