gmt_to_local()

gmt_to_local([$time = ''[, $timezone = 'UTC'[, $dst = FALSE]]])

Parameters:
  • $time (int) – UNIX timestamp
  • $timezone (string) – Timezone
  • $dst (bool) – Whether DST is active
Returns:

UNIX timestamp

Return type:

int

Takes a UNIX timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the timezone and Daylight Saving Time submitted.

Example:

$timestamp = 1140153693;
$timezone  = 'UM8';
$daylight_saving = TRUE;
echo gmt_to_local($timestamp, $timezone, $daylight_saving);

Note

For a list of timezones see the reference at the bottom of this page.

doc_CodeIgniter
2016-10-15 16:32:23
Comments
Leave a Comment

Please login to continue.