<?php
date_default_timezone_set('UTC');
$date = new \DateTime(null, new \DateTimeZone('UTC'));
$date->setTime(0,0,0);
$date->modify('next month');
$date->modify('last day of this month');
$date->setDate(2014, 1, 21);
// This should be 21st Jan 2014
echo $date->format('Y-m-d h:i:s');