Determining the user timezone in PHP becomes an headache. When you work with twitter like time stamp, (i.e. 1 minute ago), then this JavaScript library will get you the perfect timezone according to their country. Here is the simple tutorial on How to Get Default Timezone in PHP.
JsTimezoneDetect, JavaScript library which  determines perfect timezone, helps you to solve different kinds of problem. e.g. display currency according to your country, time detection or GMT detection, Coupon time left according to region etc. So there are no limitations in the scrip as writer says.

The script do not do Geo location but very useful and will not let your user select their country or others. Relaying on this script is usable and will help you to add key feature in your website and provide usability regarding  date-time across timezone.

Get Default Timezone in PHP

First Include a small minified js file in your page. Get it from the top of this website. Include it in your document or  on your page,

function timeStamp(){
?>
<script type="text/javascript">
var timezone = jstz.determine();
<?php
$timezoni = "document.write(timezone.name());";
?>
</script>
<?php
timeStamp();
date_default_timezone_set($timezoni);
}
?>

Your timezone now in the variable called $timezoni, so you can use it alone to paste a timezone. Also another function date_default_timezone_set() is the PHP built in function which set the timezone for the user. so we set the timezone by giving it a variable, saying that my timezone will be this and do all according to my desired timezone. Now you can use timestamp(); function which will return you the timezone or you can extend for the user time not the server time.
Hope you like the tutorials if anything wrong happens then do comment we will try to help you regarding this.

Method 2:

This will get you the timezone as a PHP variable. I wrote a function using jQuery and PHP. This is tested, and does work!

On the PHP page where you are want to have the timezone as a variable, have this snippet of code somewhere near the top of the page:

<?php
    session_start();
    $timezone = $_SESSION['time'];
?>

This will read the session variable “time”, which we are now about to create.

On the same page, in the <head> section, first of all you need to include jQuery:

<script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>

Also in the <head> section, paste this jQuery:

<script type="text/javascript">
    $(document).ready(function() {
        if("<?php echo $timezone; ?>".length==0){
            var visitortime = new Date();
            var visitortimezone = "GMT " + -visitortime.getTimezoneOffset()/60;
            $.ajax({
                type: "GET",
                url: "http://example.com/timezone.php",
                data: 'time='+ visitortimezone,
                success: function(){
                    location.reload();
                }
            });
        }
    });
</script>

You may or may not have noticed, but you need to change the url to your actual domain.

One last thing. You are probably wondering what the heck timezone.php is. Well, it is simply this: (create a new file called timezone.php and point to it with the above url)

<?php
    session_start();
    $_SESSION['time'] = $_GET['time'];
?>

If this works correctly, it will first load the page, execute the JavaScript, and reload the page. You will then be able to read the $timezone variable and use it to your pleasure! It returns the current UTC/GMT time zone offset (GMT -7) or whatever timezone you are in.