Hi,
In my config I prefere the international date handling with:
'date' => [
'handler' => 'intl'
],
'locale' => [
'LC_ALL' => 'de_DE.utf8'
],
that in the html environment a German output is supported with:
page()->children()->listed()>date()->toDate('EEEE, dd MMM YYYY')
The output with German date names like “Mittwoch” is supported, so far so good.
But I need for a technical feed file in the background a time-stamp in english, in the date format (RFC 2822) with: Sat, 01 Apr 2023 19:00:00 GMT.
A code with:
$page->children()->listed()->date()->toDate('EEE, dd MMM yyyy HH:mm:ss ZZZZ')
supports the RFC 2822 output, but with German names for the week and month.
I’m looking for a possibility to change the locale only for the moment, where the function is called without an influence on the whole site.
Something like:
$page->children()->listed()->date()->language('en')->toDate('EEE, dd MMM yyyy HH:mm:ss ZZZZ')
but I have no success, especially to find something in the docs.
What can I do?