Reputation: 264
How do I make a date that was initially in the format 18-10-2019 to be 181019? If the user registers, then the user will get a token number in the form of the date registered plus 1.
Upvotes: 0
Views: 74
Reputation: 552
You can format it as such;
$date = Carbon::now();
$formattedDate = $date->format('dmY');
Upvotes: 0
Reputation: 713
You can achieve it by using date
function
$d1 = '18-10-2019';
$d2 = date('dmy', strtotime($d1));
echo $d2; // 181019
Upvotes: 2