function cc::convert_timestamp in Constant Contact 6.2
Same name and namespace in other branches
- 6.3 class.cc.php \cc::convert_timestamp()
- 7.3 class.cc.php \cc::convert_timestamp()
* Converts a timestamp that is in the format 2008-08-05T16:50:04.534Z to a UNIX timestamp * * * @access public
File
- ./
class.cc.php, line 1350
Class
- cc
- @file
Code
function convert_timestamp($timestamp) {
$timestamp_bits = explode('T', $timestamp);
if (isset($timestamp_bits[0], $timestamp_bits[0])) {
$date_bits = explode('-', $timestamp_bits[0]);
$time_bits = explode(':', $timestamp_bits[1]);
$year = $date_bits[0];
$month = $date_bits[1];
$day = $date_bits[2];
$hour = $time_bits[0];
$minute = $time_bits[1];
return mktime($hour, $minute, 0, $month, $day, $year);
}
return false;
}