Jump to content

Date/Time - Timezone not being read.


Ninjakreborn

Recommended Posts

I am setting up a timestamp on a report for a client I built awhile back. I have quite a bit of experience messing with PHP dates, but never really had this issue. The timezone is set to GMT right now..I need it to default to EST and show EST time.

$date = date('l jS \of F Y h:i:s A');
$csv .= $date .', '; 
echo '<p>Time: '.$date.'</p>';

There, that shows the time. It was in GMT format..so I did some steps to try and change it.

I tried:

putenv("EST");

Afterwards I tried setting an INI file in the folder above it and set that to:

date.timezone = "EST"

It's still printing the time as...

Time: Tuesday 12th of January 2010 06:46:42 PM

When EST time would be my time (1:53 P.M.)

 

Edit: I am using, PHP Version 4.4.4.  That might be part of the issue...since I can't use that new function which allows you to set the default time.

 

Edit Part 2: Based off of my research,

date_default_timezone_set('EST');

would work if I had PHP 5. Unfortunately I don't.

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.