How to Convert UTC to Pacific Time in PHP
- 1). Open your PHP application in the PHP editor of your choice.
- 2). Type out the UTC date you want to convert and set it to a variable:
$utcTime = "2012-01-01 05:04:59"; - 3). Type, on a new line, the calculation function and set it equal to a new variable:
$pstTime = $utcTime - 28800;
This subtracts 8 hours worth of seconds from the UTC time and, since PST is UTC-8, your time is converted from UTC to Pacific time.
Source...