89 | | $_POST['post_date'] = "$aa-$mm-$jj $hh:$mn:$ss"; |
90 | | $_POST['post_date_gmt'] = get_gmt_from_date( "$aa-$mm-$jj $hh:$mn:$ss" ); |
| 89 | |
| 90 | // Ensure a real, valid date here before saving to database |
| 91 | // by converting to a Unix timestamp and then back |
| 92 | $tmp_post_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); |
| 93 | $tmp_post_date = strtotime( $tmp_post_date ); |
| 94 | $tmp_post_date = date('Y-m-d H:i:s', $tmp_post_date ); |
| 95 | |
| 96 | $_POST['post_date'] = $tmp_post_date; |
| 97 | $_POST['post_date_gmt'] = get_gmt_from_date( $tmp_post_date ); |
280 | | $_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); |
281 | | $_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] ); |
| 287 | |
| 288 | // Ensure a real, valid date here before saving to database |
| 289 | // by converting to a Unix timestamp and then back |
| 290 | $tmp_post_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); |
| 291 | $tmp_post_date = strtotime( $tmp_post_date ); |
| 292 | $tmp_post_date = date('Y-m-d H:i:s', $tmp_post_date ); |
| 293 | |
| 294 | $_POST['post_date'] = $tmp_post_date; |
| 295 | $_POST['post_date_gmt'] = get_gmt_from_date( $tmp_post_date ); |