I want to get the timezone abbreviation based on timezone name.for example, if the timezone name is America/New_york then in return I want to get the abbreviation as EST.Is there any solution available for it? I need the procedural style solution for it.Thank you
Asked
Active
Viewed 1,230 times
1 Answers
4
<?php
function getabbreviatedtimezone($location){
$date = new DateTime(null, new DateTimeZone($location));
return $date->format('T');
}
echo "The Time Zone corresponding to 'America/New York' is ".getabbreviatedtimezone('America/New_York');
?>
should do that.

sjsam
- 21,411
- 5
- 55
- 102
-
Is there any procedural method for this solution?? – EvilsEmpire Nov 09 '17 at 07:16
-
@EvilsEmpire see the updated answer. – sjsam Nov 09 '17 at 07:33
-
@EvilsEmpire pease accept the answer if it helped – sjsam Nov 09 '17 at 07:43