Converting "America/Los Angeles" to PST

Hi!

I’m not sure that this question is appropriate for the forum, so apologies in advance, but I was wondering if there’s a publicly available database that can convert php’s timezones to those that we use in everyday speech. For example, php’s timezone of “America/Los Angeles” would match up to PST. (Pacific Standard Time).

Thank you,

Eric

I would think there is somewhere but I don’t know of it. Here’s one way to get it done.


$tz = date_default_timezone_get();
date_default_timezone_set( 'America/Los_Angeles' );
$shorthand = date( 'T' );
date_default_timezone_set( $tz );

Even better! Thank you for your response.

-Eric

And here are two more, doing the same thing in different styles, that don’t affect the script-wide timezone setting:


echo date_format(date_create('now', timezone_open('America/Los_Angeles')), 'T');


$now = new DateTime('now', new DateTimeZone('America/Los_Angeles'));
echo $now->format('T');

Even cooler! Thanks to you both.

-Eric