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 I can't get a timestamp from this string.
How is this possible?
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 I can't get a timestamp from this string.
How is this possible?
This code works for every date format.
You can change the order of replacement variables such $3-$1-$2 due to your old date format.
For more:
click here
Or even shorter:
Also another obscure possibility:
I don't know if I would use it but still :)
two ways to implement this
2)
You can try
strftime
function. Something likestrftime($time, '%d %m %Y');