I have the following date: 2010-04-19 . I would like to convert this date to the ddmmyy
format.
Asked
Active
Viewed 258 times
-4

lyekameidi
- 11
- 2
-
echo date('dmy',strtotime('2010-04-09')); – JYoThI May 22 '17 at 04:23
-
possible to duplicate http://stackoverflow.com/questions/2487921/convert-date-format-yyyy-mm-dd-dd-mm-yyyy – Manojkanth May 22 '17 at 04:25
1 Answers
1
Ref: http://php.net/manual/en/function.date.php
echo date('d/m/Y', strtotime( "2010-04-19" ));
Note:- you can go for different formats. like below:-
echo date('dmy', strtotime( "2010-04-19" ));
Example:- https://eval.in/802403 And https://eval.in/802404

Alive to die - Anant
- 70,531
- 10
- 51
- 98

Long Kim
- 490
- 3
- 9
-
-
i assume nobody would want something like 19042010 with no separation between them, and since the OP is new here, he/she might not know the right question to ask, so i provided a rational answer to this common question. – Long Kim May 22 '17 at 04:35
-
i want create date with format **080616** from date with format **2016-06-08** and without separation, can it?? – lyekameidi May 22 '17 at 04:41
-
May be OP want `dd mm yy` or `dd-mm-yy`. So either ask to op to clarify or provide all three options in note section of your answer. Or atleast add a note that you can go for different formats like `dd mm yy` or `dd-mm-yy` – Alive to die - Anant May 22 '17 at 04:41
-
I can't comment with my current reputation. So it is my only method of responding, and i respect your opinion , just giving a down vote with a very brief comment with no clarification, you just did exactly what i just did. – Long Kim May 22 '17 at 04:44
-
@lyekameidi, use this instead echo date('dmy', strtotime( "2010-04-19" )); – Long Kim May 22 '17 at 04:45
-