problem in getting desired date format in loop

Posted by Rishi2686 on Stack Overflow See other posts from Stack Overflow or by Rishi2686
Published on 2010-05-29T06:22:06Z Indexed on 2010/05/29 6:32 UTC
Read the original article Hit count: 180

Filed under:
|

Hi there, I have a date format like this :

  $date1 = "Sun May 09 20:07:50 +0000 2010";

and I have to convert it to: 09-05-2010

I am using date("d-m-Y", $date1));

When I print this individually it gives proper result but I am using it in loop it gives me results like: 31-12-1969

I don't understand why this is so?

Can you help, please?

© Stack Overflow or respective owner

Related posts about php

Related posts about date