I have a column in mysql which stores the dates. So in mysql the dates are stored in Y-M-D format. However on retrieval i want to view change that format to D-M-Y . I read online at a few places and i found the date() in php, Date conversion. But they are generally for timestamp, also in many cases people had recommended to split the variable by - and then changing position.
My question is that, is splitting the variable the only option here or do we have any built in function that does that for us?
strtotimeanddateare exactly what you need for this. Unless you explicity create an obscene time string, thestrtotimefunction should accurately parse your date. You should at least try it.