-1

I have the date in the form Sat Aug 08 2015 00:00:00 GMT+0530 (India Standard Time). How can I get the date of the format "yyyy/mm/dd".

AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
akshara
  • 9
  • 6

1 Answers1

0

Try this:

echo date('Y/m/d', strtotime('Sat Aug 08 2015 00:00:00 GMT+0530') );
angelcool.net
  • 2,505
  • 1
  • 24
  • 26
  • its everytime giving 1970-01-01. I am not able to get a correct date. My date is in a variable $var. $var="Sat Aug 08 2015 00:00:00 GMT+0530" so i fetch it as $date=date('y-m-d',strtotime($var)); //1970-01-01 – akshara Aug 13 '15 at 06:25