Possible duplicate:PHP: convert date format yyyy-mm-dd => dd-mm-yyyy [NOT IN SQL]
I hope everyone has a great holiday.
I have a date in this format: 23-12-2011 and would like to cancel it in the US format 2011-12-23 .
23-12-2011
2011-12-23
Does anyone know how I can do this in PHP? Is there any function to split the lines?
date("Ymd", strtotime("23-12-2011"))
$date = DateTime::createFromFormat('dm-Y', '23-12-2011'); echo $date->format('Ym-d');
Voila. Check datetime class PHP5s
Source: https://habr.com/ru/post/1387716/More articles:How to do to display Chinese font in pdf using iTextSharp? - htmlAre you allowed to upload your own ads in the iPhone app? - iosObserver and callback do not start for accepts_nested_attributes_for - callbacksymfony2 @Template in the controller - phpHow to split between values, null values, enumerations, enumerables, nullable-enum, reference types through reflection? - reflectionExt JS 4 documentation layout - extjsThe jquery bind function has a different execution sequence between Firefox and Chrome - jqueryHow to open clip board viewer in windows 7 - windowswhen is it necessary to expose hexadecimal literals in java (bytes)? - javaHow to access the variable to which the OS is copied - vb.netAll Articles