Jump to content

PHP time


Lateralus138

Recommended Posts

Hello, I have page a friend of mine uses as a personal homepage for her browser that I made and I have recently added a time thing with this code:

 

<?php
$name=("Gerfel");
$d=date("D");
$t="Have a nice day" . " " . $_POST["name"] ."!";
?>
<form action="index.php" method="post">
  Name:
  <input type="text" name="name" />
  <input style="position:relative;top:6px;" type="image" src="images/submit.png" alt="sub" />
</form>
<?php
echo "<table><tr><td>";
echo date("m/d/Y");
echo "</td></tr></table>";
?>
<?php
echo "Today is $d!"
?>
<br />
<?php
if ($d=="Fri")
  echo "Have a nice weekend" . " " . $name ."!";
elseif ($d=="Sat")
  echo "Have a nice Saturday!" . " " . $name ."!";
elseif ($d=="Sun")
  echo "Have a nice Sunday!" . " " . $name ."!";
elseif ($d=="Mon")
  echo $t;
elseif ($d=="Tue")
  echo $t;
elseif ($d=="Wed")
  echo $t;
elseif ($d=="Thu")
  echo $t;
?>
<br />
<br />

 

She lives in the Philippines and I want to be able to set the time 14 hours ahead, is there a way to just add 14 hours to what is here. I don't want to go through the trouble of having to have her sign in. I am new to this so please don't laugh if my code is amateur and messed up, lol.

Link to comment
https://forums.phpfreaks.com/topic/191842-php-time/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.