[TYPO3-core] RFC: Bug 4666: Date formatting should use Typo3 default settings and be configurable

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Mon Jan 29 20:31:28 CET 2007


Karsten Dambekalns schrieb:
> Hi.
> 
> On 22.01.2007, at 20:11, Michael Stucki wrote:
>> While fixing this I did not only change the indexed_search example but 
>> also
>> every other place where I found date and time formattings.
>>
>> Additionally, I have added a new config var to define the formatting when
>> seconds are part of the output. See change in config_default.php.
> 
> +1, based on reading the patch.

Nice try, but flawed.

date() does not localize names (of months, etc). So date() can only but 
used where short dates (eg in lists) are possible. To be precise, for FE 
date() should never be used - use strftime() instead. And even for BE 
strftime() is the better choice.

Another problem is that the configuration in itself is flawed. It must 
not be installation specific, but language dependent. There are locale 
functions for just that purpose.

The patch also changes the format of the logging. I think the format is 
debatable, but does it need to be the same one as in the BE?

Anyway, wherever now date() is used, I agree that we should use the 
conf. var. But for the indexed search I think we should not use date(), 
but strftime().

Masi

PS: I think I have outline a scheme for better handling of date/time 
formats in BE and FE in a posting. AFAIR Andreas Otto liked it, but it 
was ignored otherwise. I think I had a kind of API call in mind that 
would determine the format (based on settings and OS locale defaults).


More information about the TYPO3-team-core mailing list