A
A
agent11562017-01-25 11:21:32
Yii
agent1156, 2017-01-25 11:21:32

How to convert the number 06 to the word may?

I am displaying dates from the database, but instead of the number 01, I need to display Jan, for example

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Finsh, 2017-01-25
@agent1156

$monthNum = 1;
$dateObj = \DateTime::createFromFormat('!m', $monthNum);
$monthName = $dateObj->format('F');
stackoverflow.com/questions/18467669/convert-numbe...

Y
Yaroslav Losev, 2017-01-25
@LosYear

www.yiiframework.com/doc-2.0/yii-i18n-formatter.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question