Q:

Trouble with displaying current time in timezone

Can someone explain why the page stops working if i add 
<?php
date_default_timezone_set("$tidszon");
echo "Klockan &auml;r " . date("h:i:sa")" i tidszonen du angav.";
?>

to the display input section of the code? everything else works fine but if i add that the page doesnt even load..
This is the default code without timezone added:

<?php
// define variables and set to empty values
$y1 = $m1 = $d1= $y2 = $m2 = $d2=  $tidszon = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
   $y1 = test_input($_POST["y1"]);
   $m1 = test_input($_POST["m1"]);
   $d1 = test_input($_POST["d1"]);
   $y2 = test_input($_POST["y2"]);
   $m2 = test_input($_POST["m2"]);
   $d2 = test_input($_POST["d2"]);   
   $tidszon = test_input($_POST["tidszon"]);
}

function test_input($data) {
   $data = trim($data);
   $data = stripslashes($data);
   $data = htmlspecialchars($data);
   return $data;
}
?>

<h2>Lookup how many days between which dates?</h2> 
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> 
   <br><br>
       Date 1:
       <br>
    <select name="y1" size="4">
    <option value="2001">2001</option>
    <option value="2002">2002</option>
    <option value="2003">2003</option>
    <option value="2004">2004</option>
    <option value="2005">2005</option>
    <option value="2006">2006</option>
    <option value="2007">2007</option>
    <option value="2008">2008</option>
    <option value="2009">2009</option>
    <option value="2010">2010</option>
    <option value="2011">2011</option>
    <option value="2012">2012</option>
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    </select>
    <select name="m1" size="4">
    <option value="1">January</option>
    <option value="2">February</option>
    <option value="3">Mars</option>
    <option value="4">April</option>
    <option value="5">May</option>
    <option value="2006">June</option>
    <option value="2007">July</option>
    <option value="2008">August</option>
    <option value="2009">September</option>
    <option value="2010">October</option>
    <option value="2011">November</option>
    <option value="2012">December</option>
    </select>
    <select name="d1" size="4">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    <br>
    <br>
    Date 2:
    <br>
    <select name="y2" size="4">
    <option value="2001">2001</option>
    <option value="2002">2002</option>
    <option value="2003">2003</option>
    <option value="2004">2004</option>
    <option value="2005">2005</option>
    <option value="2006">2006</option>
    <option value="2007">2007</option>
    <option value="2008">2008</option>
    <option value="2009">2009</option>
    <option value="2010">2010</option>
    <option value="2011">2011</option>
    <option value="2012">2012</option>
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    </select>
    <select name="m2" size="4">
    <option value="1">January</option>
    <option value="2">February</option>
    <option value="3">Mars</option>
    <option value="4">April</option>
    <option value="5">May</option>
    <option value="2006">June</option>
    <option value="2007">July</option>
    <option value="2008">August</option>
    <option value="2009">September</option>
    <option value="2010">October</option>
    <option value="2011">November</option>
    <option value="2012">December</option>
    </select>
    <select name="d2" size="4">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
   <br><br>
   Timezone:<input type="text" name="tidszon">
   <br><br>
   <input type="submit" name="submit" value="Submit"> 
</form>

<?php
echo "<h2>Your Input:</h2>";
echo "<br>"; 
echo "<br>"; 
echo "Date 1: ";
echo $y1;
echo "/";
echo $m1;
echo "/";
echo $d1;
echo "<br>";
echo "Date 2: ";
echo $y2;
echo "/";
echo $m2;
echo "/";
echo $d2;
echo "<br>";   
echo "<br>";
echo "Timezone: ";
echo $tidszon;
echo "<br>";
echo "<br>";
echo "<br>";
?>
<br>

<br>
<?php
require_once 'Date.php';
try {
    // create two Pos_Date objects new
    $dat1 = new Pos_Date();
    $dat2 = new Pos_Date();
    // calculate the number of days
        $dat1->setDate($y1,$m1,$d1);
        $dat2->setDate($y2,$m2,$d2);
    $diff = Pos_Date::dateDiff($dat1, $dat2);
    $unit = abs($diff) > 1 ? 'days' : 'day'; 
        echo "There is " . abs($diff) . " $unit between the dates";
} catch (Exception $e) {
    echo $e;
}
?>

</body>
</html>

A:

You are missing a . after date(): echo "Klockan &auml;r " . date("h:i:sa") . " i tidszonen du angav."
Put error reporting on so in the future you get informational messages concerning typos and other errors.
And on the sidenote. It's easier for you and everyone else to read the source code if you could use for example utf-8 encoding instead of html entities.

