Image

Imageeyeh8u wrote in Imagephp 😛determined

Locale and strftime

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.