-6

How to convert date format Sun Jul 13 2014 00:30:00 GMT+0530 (India Standard Time) to "YYYY-m-d"?

John
  • 129
  • 2
  • 3
  • 12
  • You need an answer which could be easily acquired by reading the documentation, you should read the PHP's docs and then report your results here in case of failure – Mostafa Talebi Jul 12 '14 at 05:11
  • There's a lot of moving parts in [the documentation](http://php.net/manual/en/class.datetime.php). Does anyone here actually know how to do it? – Robert Harvey Jul 12 '14 at 05:13

1 Answers1

1

You could use strftime and strtotime functions like this:

strftime("%Y-%m-%d", strtotime("Sun Jul 13 2014 00:30:00 GMT+0530"))
nstCactus
  • 5,141
  • 2
  • 30
  • 41