23 April 2008 at 7:40pm
Yes, of course! As this is my first patch for silverstripe: This is a Patch for "Core" against the trunk (aka 2.2.2RC3) for Milestone 2.2.3, component "Sapphire Framework", right? I will check, whether there are other places where date() is used.
Ah, what do you prefer? A general change towards strftime would require to change any format strings, as the syntax is different ("d.m.Y" vs. "%d.%m.%Y"). I still would prefer this as the standard way to format dates in silverstripe should be localized (hmm, does the word "localizable" exist?). I would track all uses of format strings in the core and in modules (I think mainly the blog module) and change them.
The alternative would be an additional function strftime().
A better solution would probaply be just adding a function called "LocalFormat" or something, which would wrap strftime as described.
This wouldn't break compatibility and features like pre-formatted ISO dates (which strftime doesn't currently supply) wouldn't be gone.