How to convert date format Sun Jul 13 2014 00:30:00 GMT+0530 (India Standard Time) to "YYYY-m-d"?
Asked
Active
Viewed 2,040 times
-6
-
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 Answers
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
-
Do not hesitate to mark this answer as accepted to improve readability. – nstCactus Jul 12 '14 at 05:21