Jump to content

date_default_timezone_set() Problem


wwfc_barmy_army

Recommended Posts

Hello.

I have been developing a site on my personal webserver on my computer but today i went to make it live on the net but i am getting this error on my server but not on my personal webserver:

[quote]Fatal error: Call to undefined function: date_default_timezone_set() in /home/rpgsfind/public_html/site.php on line 72[/quote]

It's with this bit of code:
[code=php:0]
<?php
date_default_timezone_set("US/Eastern");

list($year, $mon, $day) = explode('-', $qry[4]);

$sevenDays = (7 * 24 * 60 * 60); // 604,800 seconds in 7 days
$entryTime = strtotime("$year-$mon-$day");
$now = strtotime("now");

if (($now - $entryTime) < $sevenDays)
{
echo "<img src='images/new.gif'>";
}
?>
[/code]

Why isn't it working on the live server, do i need to change something? any advice is welcome.

Thanks.

Peter.
Link to comment
Share on other sites

Make sure the PHP version you're using on the site is greater than or equal too Version 5.1.0

Create a file on the site called phpinfo.php and have it look like this:

[code]<?php
  phpinfo();
?>[/code]

When you run it, it should produce the info you're after.

Regards
Huggie
Link to comment
Share on other sites

There's no advantage of having php4 over php5, otherwise they wouldn't have released 5 :)

As for updating, as PHP6 development is well under way and PHP5 has been out for a long time, I'd say if you have the option to upgrade then do.  Unfortunately I don't have that option as I use hosted services as opposed to my own.

I'm sure others will come to the party and chip in their two cents if I've advised incorrectly though.

Regards
Huggie
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.