Hello,
i have a problem with formatting FrozenTime values. I want to use the following code snippet
$startTime = $this->start->nice($timezoneString, $localeString);
The start atrribute is from type FrozenTime. nice is the function call from the cakephp docs. I have uploaded a picture of the docs.
I know that FrozenTime is immutable but my example from above should work i think. I am using the nice format as it is shown in the doc.
But the function always gives back the following date format: “Oct 28, 2023, 11:54 AM”
even if I change the locale string for example to german. I tried to debug this problem but i can’t find an answer to the problem.
Would be pretty nice if someone can help me.
I have the php Version 8.1.8 and cakephp Version 4.4.16.
thanks for your answer. Your output is exactly that for what i am looking for. I have checked my php modules. intl is listed if i type in php -m. That fits. I checked also my installed ICU Version. It gives back other version than yours.
ICU version => 71.1
ICU Data version => 71.1
ICU Unicode version => 14.0
I have no ICU TZData version like you. Could that be the problem?
Also, yes, you can very much chain calls on immutables. Each call returns a new object, which the next call then acts on. $this->start->addMonth()->firstOfMonth()->nice(...) will give you the nice format for the first day of the month after the start date of the thing.