Check and set default timezone

Views: 4 Last modified: August 03rd, 2011 Comments: 0

How to check the php.ini file and set the timezone accordingly.

<?php
// Checks the php.ini file, if return false, set a default timezone
if (!@ini_get('date.timezone'))
    date_default_timezone_set('Atlantic/Azores');
?>

A list with supported timezones can be found here!

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

    Mail this!

    To: From:Sum {1+9} =  
    Anything to add ?

        You must be logged in to post a comment.