use POSIX qw(strftime); my $now_string = strftime "%Y-%m-%d %H:%M:%S", localtime; use DBI; my $dbh = DBI->connect('DBI:mysql:foothills', 'root', '') or die; my $sth = $dbh->prepare("INSERT INTO users values('test', 'test', 1, 1, 1, 1, ?)"); $sth->execute($now_string); $dbh->disconnect();