note 115595 added to function.date-default-timezone-set
| From: | okhugo at gmail dot com | Date: | Fri, 22 Aug 2014 00:07:05 +0000 |
| Subject: | note 115595 added to function.date-default-timezone-set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200239@lists.php.net to get a copy of this message | ||
Get the difference between current timezone and UTC/GMT
<?php
function dif_hora(){
$zona_s= date('P');
$t=explode(":",$zona_s);
$horas=($t[0])*1;
$sale['horas']=$horas;
$sale['min']=$horas*60;
$sale['seg']=$horas*60*60;
return $sale;
}
print_r (dif_hora());
// Changing default server zone America/New_York
ini_set('date.timezone','America/Costa_Rica');
print_r (dif_hora());
?>
result:
Array
(
[horas] => -4
[min] => -240
[seg] => -14400
)
Array
(
[horas] => -6
[min] => -360
[seg] => -21600
)
----
Server IP: 72.52.91.14
Probable Submitter: 201.192.31.6
----
Manual Page -- http://php.net/manual/en/function.date-default-timezone-set.php
Edit -- https://master.php.net/note/edit/115595
Del: integrated -- https://master.php.net/note/delete/115595/integrated
Del: useless -- https://master.php.net/note/delete/115595/useless
Del: bad code -- https://master.php.net/note/delete/115595/bad+code
Del: spam -- https://master.php.net/note/delete/115595/spam
Del: non-english -- https://master.php.net/note/delete/115595/non-english
Del: in docs -- https://master.php.net/note/delete/115595/in+docs
Del: other reasons-- https://master.php.net/note/delete/115595
Reject -- https://master.php.net/note/reject/115595
Search -- https://master.php.net/manage/user-notes.php