Answer the question
In order to leave comments, you need to log in
How to implement the output of months in Russian in the standard php DateTime class?
$this->DateTime = new DateTime();
...
return $this->DateTime->format('Y-m-d H:i:s');
Answer the question
In order to leave comments, you need to log in
Brings exactly your format to the form January 1, 2014 15:30.
function getRusDate($datetime) {
$yy = (int) substr($datetime,0,4);
$mm = (int) substr($datetime,5,2);
$dd = (int) substr($datetime,8,2);
$hours = substr($datetime,11,5);
$month = array ('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря');
return ($dd > 0 ? $dd . " " : '') . $month[$mm - 1]." ".$yy." г. " . $hours;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question