php strtotime给出默认日期

I want to convert date into another format but its shows default date.

$date ='2050-12-12 00:00:00';

echo $product_expire_date = date('Ymd', strtotime($date));

It shows the default date 19700101.

Use strtotime() and date():

$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));

(see strtotime and date docs on the PHP site).

The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.)

http://php.net/strtotime#refsect1-function.strtotime-notes

First of all your date is exceeding 2038 and hence you are getting the default date... and if you simply want the date from that string, you can explode the string and echo the first index like

$date = explode(' ', '2050-12-12 00:00:00');
echo $date[0]; //Echoes date
echo $date[1]; //Echoes time

Try this:

<?php
$date       =    '2050-12-12 00:00:00';
$newdate     =    explode(" ",$date);
$newdate1    =    explode("-",$newdate[0]);
echo $newdate1[0].$newdate1[1].$newdate1[2];
?>