diff --git a/shomble.pl b/shomble.pl index 6e24370..390749a 100755 --- a/shomble.pl +++ b/shomble.pl @@ -20,7 +20,7 @@ print "Confirming this is your post:\n".$post."\n Is this correct? (you must typ if ( =~ /y(es)?/i ) { #this needs to be called right before the post is submitted to the database. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); - my $timeStamp = $mday."/".$mon."/".($year + 1900)." ".$hour.":".$min.":".$sec; + my $timeStamp = sprintf("%.2d/%.2d/%.4d %.2d:%.2d:%.2d", $mday, ($mon + 1), ($year + 1900), $hour, $min, $sec; my $statmentHandle = $db->prepare('INSERT INTO posts VALUES( ?1, ?2, ?3)') or die $DBI::errstr; $statmentHandle->execute( $timeStamp, $username, $post ) or die $DBI::errstr;