Is there a way to display the current date and time on my home page?
Peter
MusicGrams4U.com
Is there a way to display the current date and time on my home page?
Peter
MusicGrams4U.com
Your homepage needs to be made into a php page.
Create a html box and insert the code below
<?=date('F j Y g:i A')?>
If you want to change the date and time formatting visit
http://us2.php.net/manual/en/function.date.php
for a complete list of formatting options
Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Umm, I am not aware of a built in function, I believe you have to do
<?=date('F j Y g:i A', time()+(3600*6))?>
The format being
<?=date('F j Y g:i A', time()[+ or -](3600*[hours to add or subtract]))?>
Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
This was perfect <?=date('F j Y g:i A', time()+(3600*6))?> & is a nice 7.15am in the uk. I will have a look through the site you left a link to, to see if there is anything about the hour we loose for winter & summertime savings in the UK.
Must admit i am not sure if other contrys have this or not.
Cheers.
You can tell if the current day is daylight savings by doing this
if(date('I'))
{
// The time is daylights saving
}
else
{
// The time is normal
}
And adjust the date accordingly. I believe the time adjustment will different depending if you are in the north or south hemisphere. But all you would have to do is and place it in the if else statement above
<?=date('F j Y g:i A', time()+(3600*(6+ or - 1)))?>
Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
There are currently 1 users browsing this thread. (0 members and 1 guests)