Date::now()->subDays(2)->format('Y-m-d') code example Example: php datetime create $date = DateTime::createFromFormat('d-m-Y', '15-12-2020');