Jump to content

Old date displayed


madhu

Recommended Posts

I used the following code snippet and created header.php

 

I used the include option <?php include "header.php"; ?> to to display the date in other page.

 

Yesterday it displayed "Today is June 06, 2009" correctly. But today my system date is June 07 2009. But the pages still display "Today is June 06, 2009". Why it is displaying the old date. Please help me.

 

Code in header.php

<div align="center"><font size="4">Welcome to my movie review site!</font>

<br>

<?php

echo "Today is ";

echo date("F d");

echo ", ";

echo date("Y");

?>

</div>

Link to comment
Share on other sites

Where is your PHP script being ran? If you are running it from your own computer it should be displaying your date. If you are running it from an external server, it will use that server's date. At the time of writing this, it is still June 6th here in the USA, so if you are being hosted by a USA server, then, that date being displayed is quite correct.

Link to comment
Share on other sites

When I use

echo date('Y-m-d H:i:s');

time is getting refreshed for every refresh I give.

 

But I noticed one strange thing. When my system time is 1:40 PM, the time displayed in the page 5:40 AM (Now the date displayed is June 07, 2009). How come this difference arise ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.