Hi,
I'm trying to get PHP to output the current timezone abbreviation, also taking into account DST.
With date(), this works fine using the 'T' format string, in combination with date_default_timezone_set(), as follows:
Timezone: 'Europe/London'; 'T': GMT or BST (DST)
Timezone: 'Europe/Prague'; 'T': CET or CEST (DST)
Timezone: 'UTC'; 'T': UTC (always)
But if I use the same 'T' format string with DateTime::format(), which I need to do in my problem scenario, it always outputs a GMT offset instead, like
Timezone: 'Europe/London'; 'T': GMT +01:00
However, the PHP manual suggests that the interpretation of format strings is meant to be identical for both date() and DateTime::format().
Anyone had similar problems, or know a work around for getting the proper abbreviation (e.g. BST, CEST) with DateTime::format()? Is it an OS-dependant thing?
I'm using PHP 5.2.6 with Apache/2.0.54 (Fedora)
Jon