Jump to content


Photo

date_default_timezone_set()


  • Please log in to reply
2 replies to this topic

#1 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 02 August 2006 - 06:14 PM

Weird problem:

I have a file that I include on every page of my site that looks like this:
<?php
date_default_timezone_set('US/Eastern');
//functions and variables and what not
?>

When I require() that file from a page, it loads fine. But when I require() that file from /cron/main.php (outside the public directory), I get an error that says something like "Call to undefined function date_default_timezone_set()".
If it means anything, main.php is run by a...you guessed it...cron. main.php also require()s two other files, and they get included fine.

Any idea?

(Yay formatting!)
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#2 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 02 August 2006 - 07:51 PM

In some other form I saw the following tip:

I did come across the putenv function

$timeZone = "TZ=US/Eastern";
putenv( $timeZone );

seems to work for php date/time and sql statements.


Worth a try?

Ronald  8)
RTFM is an almost extinct art form, it should be subsidized.

#3 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 03 August 2006 - 01:00 AM

I read that putenv() has some problems or something. But why isn't d_d_t_s() working with the cron?
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users