Locale and strftime

    Date: 03/08/06 (PHP Community)    Keywords: php, rss

    I need to produce date times in an ISO standard format for RSS feeds.

    This requires the format to include month and day abbreviations (jan, feb, mar... mon, tue, wed) etc.

    These must be in en_gb (same as en_us) format for the date format to be correct.

    strftime insists on formatting to the locale settings, so I get things like

    Mi, 08 Mär 2006 14:42:05 +0100


    Which is no use It has to be Mon, 08 Mar 2006 14:42:05 +0100

    Is there anyway to do a getlocale so I can cache the old locale before calling a setlocale to override to en_gb briefly for the stftime operation then quickly set PHP back to the old locale for the rest of the processing?

    Or do I really have to re-implement strftime in a locale-insensitive way?

    Cheers.

    Source: http://community.livejournal.com/php/422960.html

« Reg ex help || Output Validation? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home