Example code:
$a = new IntlDateFormatter('en-US', IntlDateFormatter::FULL, IntlDateFormatter::NONE, 'Europe/London', IntlDateFormatter::GREGORIAN);
var_dump($a->format(strtotime('2021-09-17 15:00')));
$a = new IntlDateFormatter('sv-SE', IntlDateFormatter::FULL, IntlDateFormatter::NONE, 'Europe/London', IntlDateFormatter::GREGORIAN);
var_dump($a->format(strtotime('2021-09-17 15:00')));
Actual output:
string(26) "Friday, September 17, 2021"
string(24) "fredag 17 september 2021"
Wanted output:
string(26) "Friday, September 17"
string(24) "fredag 17 september"
Changing IntlDateFormatter::FULL
to IntlDateFormatter::LONG
does not help. It only makes the output like this:
string(18) "September 17, 2021"
string(17) "17 september 2021"
Neither of IntlDateFormatter::NONE
, IntlDateFormatter::SHORT
and IntlDateFormatter::MEDIUM
cause the desired output.
I specifically want the "full" one, but just not the year part.
Please do not suggest any solution which attempts to "hack" away the year, such as string/regexp-removing it. I need the solution to cause the engine to not include the year part in the output. I am sure that other locales have much more complicated/different year parts than the two ones I have used as examples.