86 | | $hh = ($hh > 23 ) ? $hh -24 : $hh; |
87 | | $mn = ($mn > 59 ) ? $mn -60 : $mn; |
88 | | $ss = ($ss > 59 ) ? $ss -60 : $ss; |
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" ); |
| 86 | $hh %= 24; |
| 87 | $mn %= 60; |
| 88 | $ss %= 60; |
| 89 | |
| 90 | |
| 91 | // Ensure a real, valid date here before saving to database |
| 92 | // by converting to a Unix timestamp and then back |
| 93 | $tmp_post_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); |
| 94 | $tmp_post_date = strtotime( $tmp_post_date ); |
| 95 | $tmp_post_date = date('Y-m-d H:i:s', $tmp_post_date ); |
| 96 | |
| 97 | $_POST['post_date'] = $tmp_post_date; |
| 98 | $_POST['post_date_gmt'] = get_gmt_from_date( $tmp_post_date ); |
277 | | $hh = ($hh > 23 ) ? $hh -24 : $hh; |
278 | | $mn = ($mn > 59 ) ? $mn -60 : $mn; |
279 | | $ss = ($ss > 59 ) ? $ss -60 : $ss; |
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'] ); |
| 285 | $hh %= 24; |
| 286 | $mn %= 60; |
| 287 | $ss %= 60; |
| 288 | |
| 289 | |
| 290 | // Ensure a real, valid date here before saving to database |
| 291 | // by converting to a Unix timestamp and then back |
| 292 | $tmp_post_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); |
| 293 | $tmp_post_date = strtotime( $tmp_post_date ); |
| 294 | $tmp_post_date = date('Y-m-d H:i:s', $tmp_post_date ); |
| 295 | |
| 296 | $_POST['post_date'] = $tmp_post_date; |
| 297 | $_POST['post_date_gmt'] = get_gmt_from_date( $tmp_post_date ); |