hi..
how can we get pacific time in php
Thank you
If you have access to php.ini, you can set this by changing the date.timezone value.
[Date]
; Defines the default timezone used by the date functions
date.timezone = America/Los_Angeles
Also, if you just want to change the timezone for local script, use the date_default_timezone_set function.
<?php
date_default_timezone_set('America/Los_Angeles');
$time=date('h:i A');
echo $time;
?>
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.