From 35300bae9bdaa9882fa8f1b9abca572bb56e18c7 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Fri, 7 May 2021 13:48:56 -0600 Subject: [PATCH] Fixed timestamp formatting to be consistant --- shomble.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;