Jump to content

[SOLVED] date_default_timezone_set not working


chmpdog

Recommended Posts

hey,

 

On my site, I have a countdown script that counts down to a specific time. [user the time() function] Now I always want it to countdown in eastern time so I put in te code:

date_default_timezone_set ("America/New_York");

but if I change the time on my computer it effects the countdown script.

 

How do I set my server time to EDT?

 

Thanks

Link to comment
Share on other sites

but if I change the time on my computer it effects the countdown script.

Ermm.. thats weird you must be using some javascript!

 

can you post your script

 

How do I set my server time to EDT?

type date to see the current date

use the command

"date" from the terminal

IE

Thu Feb 16 10:33:56 PST 2009

 

Then, to change it, type this:

date --set='Thu Feb 16 08:33:56 PST 2009'

Link to comment
Share on other sites

What php version and what is your actual code.

 

The time zone setting only affects functions like date, mktime, strtotime... when they convert to/from a Unix Timestamp. Changing the actual time on your computer changes the Unix timestamp value because the time is no longer the correct number of seconds since Unix Epoch.

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.