0

Hi, How can i return the server date? using

<?php $my_t=getdate(date("U")); 
print("$my_t[weekday], $my_t[month] $my_t[mday], $my_t[year]"); ?>

gives me errors :(

Thanks in advance, I know it probably has a very easy solution, but I just dont know what as I'm so totally new to php..

6
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

Try this

<?
$day=getdate();
echo($day['wday']."/".$day['mon'])."/".$day['year']);
?>
0

Hi,

I am sharing a tip with you.

Sometimes our server shows a different time than the time shown on our clock, the most probable reason is that our hosting server is in a different time-zone.

We can easily set our server time to our time zone changing a setting in PHP called date.timezone.
In order to set the new time in every file, we need not update the new time in all the files, all that we would need to do is replace a single line in htaccess file.

To set a time zone for your entire account or directory, create a .htaccess file in the upper directory with the line:

Hope you find this tips useful and of assistance.

Thanks,
Suryakant

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.