I want to convert
令和元年8月 = 2019年8月
Ref https://www.conservapedia.com/Japanese_dates
Here I get these
For this I tried code like below here "平成31年8月" returning 2019 but according to ref it should 令和元年8月 Please suggest me is there any solution so I can set my code like reference..
$formatter = new IntlDateFormatter(
'ja_JP@calendar=japanese',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Europe/Madrid',
IntlDateFormatter::TRADITIONAL,
'Gy年M月'
);
$ts = $formatter->parse('令和元年8月');
//$ts = $formatter->parse('平成31年8月');
var_dump($ts, date('Y-m', $ts));