If you are using a Unix system, run the following script on the database server:
Code:
#!/usr/bin/perl
use DBI;
$dbh = DBI->connect("dbi:mysql:test", "root", "" );
$sql = "SELECT UNIX_TIMESTAMP( NOW() )";
$sth = $dbh->prepare( $sql );
if ( $sth->execute() ) {
while( ( my $sqltime ) = $sth->fetchrow_array() ) {
print "MySQL NOW() returned : $sqltime\n";
}
}
$time = time();
print "Perl Time Stamp : $time\n";
exit;
The output should look something like this:
Code:
$ perl test.pl
MySQL NOW() returned : 1062839545
Perl Time Stamp : 1062839545
The time stamps should not differ with more then one second. If it does, I suspect something wrong with MySQL.
Cheers