So...it would look like:

$dt->strftime($dt->locale->medium_date_format);

could we get a shortcut method like:

$dt->locale_strftime('medium');

the object should be able to use the locale it already contains; I shouldn't have to pass it in. We already have shortcuts for ->mdy, ->dmy, ->hms so there should be a nice little shortcut for a locale-aware getter. The presence of the former in the documentation might lead one to believe an if statement would be the best way to localize this use case (m/d/y vs d/m/y).

-D



Dave Rolsky wrote:
On Mon, 8 Dec 2003, Doug Treder wrote:


and I know that locale knows what formatting it prefers (such as
day-month-year versus month-day-year abbreviations).  But is there an
less verbose way to pull it out than this:

$dt->strftime($dt->locale->date_formats->{'medium'});

I was hoping for something like $dt->medium_format.... does it exist?


$dt->locale->medium_date_format

The locale classes need better docs, I think.


-dave


/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/



Reply via email to