About php date format -
my current date format is
15/may/2015
i want as
05/15/2015
please me this. in advance.
given have sort of timestamp already, can this:
$date = date('m/d/y', $timestamp);
if don't have timestamp, let's assume have current date stored in variable:
$original = '15/may/2015';
you can this:
$date = date('m/d/y', strtotime($original));
alternatively, can use datetime
class:
$date = datetime::createfromformat('d/m/y', $original)->format('m/d/y'); // assumed 'd/m/y' current format ^ // 'j/m/y', 'd/f/y', 'j/f/y', etc.
Comments
Post a Comment