-4

I have the following date: 2010-04-19 . I would like to convert this date to the ddmmyy format.

lyekameidi
  • 11
  • 2

1 Answers1

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
  • `ddmmyy` !==`d/m/y` – Alive to die - Anant May 22 '17 at 04:26
  • 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
  • @LongKim thanks you and i will try it. . – lyekameidi May 22 '17 at 04:47