PHP Configuring Help On Site Please

Status
Not open for further replies.

Hustla

New Member
Messages
11
Reaction score
0
Points
0
Im wanting to change my php time on my site. Where do you go to do this, im guessing its somewhere in phpMyAdmin, but I don't know where you would go from their.

The reason I want to change this is because im having my site log the visitors ip, date and time. But the problem is the time displays an hour before my time.

Example:
it would log like 12:17 PM, but really my time is an hour after at 1:17 PM

My Code:
$dateTime = date('m/d/Y G:i:s A');

My friend said tho that its most likely the php settings.

Please help me and thanks!:biggrin:
 

jtwhite

Community Advocate
Community Support
Messages
1,381
Reaction score
30
Points
0
The PHP configuration is set by the administrators of the server. You cannot change these settings. I'm sure you won't do it through phpMyAdmin because that is for editing MySQL databases.

You may be able to write a PHP code that automatically removes one hour from what the server says.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
'date' takes two arguements. The first is the format string. The second is optional and defaults to the value of time().
Since the value of time() is server time and the time you want is an hour later, just add an hour (60*60 = 3600 seconds), so...

$dateTime = date('m/d/Y G:i:s A' , time() + 3600 );

should work.
 
Status
Not open for further replies.
Top