Hi - I would like to convert a timestamp integer to a localtime string. If the input was a timestamp string (rather than an integer), I could use the datetime object as noted below.
// set object
$date = new DateTime($utc_timestamp, new DateTimeZone($utc_timezone));
// change to local timezone and create output
$date->setTimezone(new DateTimeZone($localtimezone));
$localtimestamp = $date->format('Y-m-d H:i:s');
I am sure that there is a simple solution that I am unaware of, I look forward to your insights, thanks!
Pete
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER