Simple usage of DateTimeImmutable Class:
<?php
$format = "Y-m-d";
$dateString = "2015-01-25";
// Get new DateTimeImmutable Object
$date = DateTimeImmutable::createFromFormat($format,$dateString);
var_dump($date);
// DateTimeImmutable object can be used similar to DateTime object
echo $date->format("Y/m/d");