I want to print formatted dates on my page. I have an object date and I use $this->Time->format() for formatting. Everything works fine before December 27th. Unfortunately all dates after the December 26th, formatting change my year number.
This is my debug($date)
object(CakeI18nTime) {
'time' => '2015-12-30T00:00:00+0000',
'timezone' => 'UTC',
'fixedNowTime' => false
}
This is my debug($this->Time->format($date, 'YYYY'))
'2016'
I tried to use i18nFormat but I have the same problem. Here is my debug($date->i18nFormat('YYYY'));
'2016'
Thanks for your help
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…