Quantcast
Channel: Tech Support Guy
Viewing all articles
Browse latest Browse all 29110

Solved: MySql/php date stamp inaccurate?

$
0
0
I have noticed that when I place a unix date/time stamp into a db field it consistemtly files a time of 5 minutes past the hour:confused:
I have set the session timezone like so ...
PHP Code:

    date_default_timezone_set('GMT'); 

I obtain the current time like this ...
PHP Code:

$date_time time(); 

and am converting it for display, thus...
PHP Code:

$format = ("D d M Y h:m");
$date_time date($format$row["date_time"]); 

It may well be that it has something to do with the MySql set up - which is simply VARCHAR(11) - current maximum size being (10)
Can anyone see how this is happening and perhaps put me straight?

Viewing all articles
Browse latest Browse all 29110

Trending Articles