I have this code
$dateTime = new DateTime('@'.strtotime('+30 minutes')); $dateTime->setTimezone(new DateTimeZone($someModel->timezone)); $otherModel->send_at = $dateTime->format($otherModel->getDateTimeFormat());
Where $otherModel->getDateTimeFormat() returns "M/d/yy h:mm a" which is fine because it is based on the current locale.
Now, when i pass this format to PHP’s datetime::format class method [$dateTime->format($otherModel->getDateTimeFormat())] i get this result: “Dec/06/1313 03:1212 pm” which is looking weird because the format that php accepts for date/datetime is not the same as the one Yii is using in it’s locales.
How can i fix this ?