Location: PHPKode > projects > SCOP Heartbeat Administration interface > scop-2.0/html/scop/config/changetimezone.php
<?
include ("../inc/header.inc");
include ("../inc/functions.inc");

$newzone = $_POST['newzone'];


$trans="15b";
$a15b = "${$l.$trans}";
$trans="6";
$a6 = "${$l.$trans}";
$trans="15a";
$a15a = "${$l.$trans}";

?>
<div id="contentArea">
<h1><a href="/scop/index.php?menu=logs&l=<?=$l?>"><?=$a6?></a> &gt; <?=$a15b?></h1>
<div class="border">			
<?
//echo "<h2>$a15b</h2>";

if ($action==changezone) {
			//Change the timezone here
			exec ("sudo cp /usr/share/zoneinfo/Etc/$newzone /etc/localtime");
			//NB.Should do a sanity check on input here.
				$trans="61";
				$a61 = "${$l.$trans}";
			echo "$a61<br><b>" . `date` . "</b>" ;

} else {
	//Read the timezone data and display the form to change it

	exec ("sudo /usr/sbin/ntpdate time.nist.gov > /dev/null 2>&1 &"); //Update the current time first
	$trans="61";
	$a61 = "${$l.$trans}";
	echo "$a61<br><b>" . `date`;


	echo "</b><br><br><FORM method=\"post\" action=\"changetimezone.php?action=changezone&l=$l\">";
	echo "<select name=\"newzone\" class=\"selectList\"><option value=\"GMT-12\">(GMT-12:00)Eniwetok, Kwajalein</option><option value=\"GMT-11\">(GMT-11:00)Midway Island, Samoa</option><option value=\"GMT-10\">(GMT-10:00)Hawaii</option><option value=\"GMT-9\">(GMT-09:00)Alaska</option><option value=\"GMT-8\">(GMT-08:00)Pacific Time (US &amp; Canada); Tijuana</option><option value=\"GMT-7\">(GMT-07:00)Arizona</option><option value=\"GMT-7\">(GMT-07:00)Mountain Time (US &amp; Canada)</option><option value=\"GMT-6\">(GMT-06:00)Central Time (US &amp; Canada)</option><option value=\"GMT-6\">(GMT-06:00)Mexico City, Tegucigalpa</option><option value=\"GMT-6\">(GMT-06:00)Saskatchewan</option><option value=\"GMT-5\">(GMT-05:00)Bogota, Lima, Quito</option><option value=\"GMT-5\">(GMT-05:00)Eastern Time (US &amp; Canada)</option><option value=\"GMT-5\">(GMT-05:00)Indiana (East)</option><option value=\"GMT-4\">(GMT-04:00)Atlantic Time (Canada)</option><option value=\"GMT-4\">(GMT-04:00)Caracas, La Paz</option><option value=\"GMT-4\">(GMT-04:00)Santiago</option><option value=\"GMT-3\">(GMT-03:30)Newfoundland</option><option value=\"GMT-3\">(GMT-03:00)Brasilia</option><option value=\"GMT-3\">(GMT-03:00)Buenos Aires, Georgetown</option><option value=\"GMT-2\">(GMT-02:00)Mid-Atlantic</option><option value=\"GMT-1\">(GMT-01:00)Azores, Cape Verde Is.</option><option value=\"GMT\">(GMT)Casablanca, Monrovia</option><option value=\"GMT\" selected=\"selected\">(GMT)Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London</option><option value=\"GMT+1\">(GMT+01:00)Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option><option value=\"GMT+1\">(GMT+01:00)Belgrade, Bratislava, Budapest, Ljubljana, Prague</option><option value=\"GMT+1\">(GMT+01:00)Barcelona, Madrid</option><option value=\"GMT+1\">(GMT+01:00)Brussels, Copenhagen, Paris, Vilnius</option><option value=\"GMT+1\">(GMT+01:00)Sarajevo, Skopje, Sofija, Warsaw, Zagreb</option><option value=\"GMT+2\">(GMT+02:00)Athens, Istanbul, Minsk</option><option value=\"GMT+2\">(GMT+02:00)Bucharest</option><option value=\"GMT+2\">(GMT+02:00)Cairo</option><option value=\"GMT+2\">(GMT+02:00)Harare, Pretoria</option><option value=\"GMT+2\">(GMT+02:00)Helsinki, Riga, Tallinn</option><option value=\"GMT+2\">(GMT+02:00)Jerusalem</option><option value=\"GMT+3\">(GMT+03:00)Baghdad, Kuwait, Riyadh</option><option value=\"GMT+3\">(GMT+03:00)Moscow, St. Petersburg, Volgograd</option><option value=\"GMT+3\">(GMT+03:00)Mairobi</option><option value=\"GMT+3\">(GMT+03:30)Tehran</option><option value=\"GMT+4\">(GMT+04:00)Abu Dhabi, Muscat</option><option value=\"GMT+4\">(GMT+04:00)Baku, Tbilisi</option><option value=\"GMT+4\">(GMT+04:30)Kabul</option><option value=\"GMT+5\">(GMT+05:00)Ekaterinburg</option><option value=\"GMT+5\">(GMT+05:00)Islamabad, Karachi, Tashkent</option><option value=\"GMT+5\">(GMT+05:30)Bombay, Calcutta, Madras, New Delhi</option><option value=\"GMT+6\">(GMT+06:00)Astana, Almaty, Dhaka</option><option value=\"GMT+6\">(GMT+06:00)Colombo</option><option value=\"GMT+7\">(GMT+07:00)Bangkok, Hanoi, Jakarta</option><option value=\"47\">(GMT+08:00)Beijing, Chongqing, Hong Kong, Urumqi</option><option value=\"GMT+8\">(GMT+08:00)Perth</option><option value=\"GMT+8\">(GMT+08:00)Kuala Lumpur, Singapore</option><option value=\"GMT+8\">(GMT+08:00)Taipei</option><option value=\"GMT+9\">(GMT+09:00)Osaka, Sapporo, Tokyo</option><option value=\"GMT+9\">(GMT+09:00)Seoul</option><option value=\"GMT+9\">(GMT+09:00)Yakutsk</option><option value=\"GMT+9\">(GMT+09:30)Adelaide</option><option value=\"GMT+9\">(GMT+09:30)Darwin</option><option value=\"GMT+10\">(GMT+10:00)Brisbane</option><option value=\"GMT+10\">(GMT+10:00)Canberra, Melbourne, Sydney</option><option value=\"GMT+10\">(GMT+10:00)Guam, Port Moresby</option><option value=\"GMT+10\">(GMT+10:00)Hobart</option><option value=\"GMT+10\">(GMT+10:00)Vladivostok</option><option value=\"GMT+11\">(GMT+11:00)Magadan, Solomon Is., New Caledonia</option><option value=\"GMT+12\">(GMT+12:00)Auckland, Wllington</option><option value=\"GMT+12\">(GMT+12:00)Fiji, Kamchatka, Marshall Is.</option></select>";

	echo "<tr><td><br><INPUT type=\"submit\" value=\"$a15b\" name=\"go\" ></td></tr>";
	echo "</FORM>";
	$trans="60";
	$a60 = "${$l.$trans}";
	echo "</br>$a60";

}

?>
</div>
<div class="bottom"><span>-----</span></div>
</div>
<?

include ("../inc/footer.inc");
?>
Return current item: SCOP Heartbeat Administration interface