Uploader

An all around general purpose file uploader for CakePHP. Packaged as a stand alone plugin with file validation, file scanning and support for a wide range of basic mime types.

Timestamp in Timezone

Gets a unix timestamp within a certain timezone.

Function: timeInZone()
Category: PHP
Views: 1,115
Permalink - Tinylink

/**
 * Gets a unix timestamp within a certain timezone
 * @param int $timeStamp
 * @param int $timeZone
 * @return int
 */
function timeInZone($timeStamp, $timeZone = -8) {
	return strtotime(gmdate('Y-m-d h:i:sa', $timeStamp + (3600 * $timeZone)));
}

Return to Snippets