Skip to content

Converting Unix Time Stamp

bman46 edited this page Jul 17, 2017 · 12 revisions

In order to convert the unix timestamp from its unix time to your local time you need to add the following code where you would like to convert it:

For Last Log Off:
<?php
echo date("Y-m-d\TH:i:s\Z", $steamprofile['lastlogoff']);
?>
For When Profile Was Created:
<?php
echo date("Y-m-d\TH:i:s\Z", $steamprofile['timecreated']);
?>
Set Default/Local Timezone with:
date_default_timezone_set(/*timezone_identifier*/);

More info about the set timezone code listed above on this website: http://php.net/manual/en/function.date-default-timezone-set.php ######Tips and Tricks:

  • Use gmdate() instead of date() to get the GMT date/time
  • for more info on date() function check here