From 9da2338021ee0600579131be424364978c299e6a Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 7 Mar 2006 21:00:38 +0000 Subject: [PATCH] Pad post_date elements. Props: masquerade. fixes #2542 git-svn-id: https://develop.svn.wordpress.org/trunk@3632 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 2918f56ec9..498f6b1566 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -75,8 +75,8 @@ function write_post() { $hh = ($hh > 23) ? $hh -24 : $hh; $mn = ($mn > 59) ? $mn -60 : $mn; $ss = ($ss > 59) ? $ss -60 : $ss; - $_POST['post_date'] = "$aa-$mm-$jj $hh:$mn:$ss"; - $_POST['post_date_gmt'] = get_gmt_from_date("$aa-$mm-$jj $hh:$mn:$ss"); + $_POST['post_date'] = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss); + $_POST['post_date_gmt'] = get_gmt_from_date($_POST['post_date']); } // Create the post.