stupid timestamp!
Moderator: General Moderators
stupid timestamp!
okay, for the third time
what is wrong with this? I want the timezone to be the exact same as here in OHIO!
This was working correctly for the longest time, now when I use it, its an hour off!?!?
WHATTTTTTT in the sam hell is wrong with this POS? grr grr
$time = date('g:i A', (time()-(23*60*60)));
what is wrong with this? I want the timezone to be the exact same as here in OHIO!
This was working correctly for the longest time, now when I use it, its an hour off!?!?
WHATTTTTTT in the sam hell is wrong with this POS? grr grr
$time = date('g:i A', (time()-(23*60*60)));
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
Whoa.. what on earth is all that date/time() foo for? Save yourself the hassle... do it the easy way:
This assumes that the server the script is running on is 5 hours ahead of what you need. Adjust the "time" accordingly if not.
Code: Select all
$ohio_time = strtotime("-5 hours");- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
Yeah, so:
Code: Select all
echo date('g:i:A', strtotime("-5 hours"));I bet it worked before DST came into effecttim wrote:Code: Select all
$time = date('g:i A', (time()-(23*60*60)));
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
If you don't need to modify the timestamp, don't bother with the strtotime() part at all!
Heck, you don't even need the time() part as it'll assume it by default!
The above will work just fine (does here anyway). Check that the time setting on your server is actually correct and hasn't been messed up somehow? Might be your hosts fault rather than anything else.
Code: Select all
$time = date('g:i:A', time());The above will work just fine (does here anyway). Check that the time setting on your server is actually correct and hasn't been messed up somehow? Might be your hosts fault rather than anything else.
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact: