I am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy (but not in SQL); however I don\'t know how the date function requires a timestamp, and
yyyy-mm-dd
dd-mm-yyyy
For this specific conversion we can also use a format string.
$new = vsprintf('%3$s-%2$s-%1$s', explode('-', $old));
Obviously this won't work for many other date format conversions, but since we're just rearranging substrings in this case, this is another possible way to do it.