protected function _getTimePublishedInUnixTime($index)
 {
     $publishedNode = $this->_relativeQuery($index, 'media:group/yt:uploaded');
     if ($publishedNode->length == 0) {
         return '';
     }
     $rawTime = $publishedNode->item(0)->nodeValue;
     return org_tubepress_impl_util_TimeUtils::rfc3339toUnixTime($rawTime);
 }
 private function _fancyTime($unixTime)
 {
     if ($unixTime == '') {
         return '';
     }
     if ($this->_context->get(org_tubepress_api_const_options_names_Display::RELATIVE_DATES)) {
         return org_tubepress_impl_util_TimeUtils::getRelativeTime($unixTime);
     }
     return date($this->_context->get(org_tubepress_api_const_options_names_Advanced::DATEFORMAT), $unixTime);
 }
Example #3
0
 function testRfc3339toUnixTime()
 {
     $result = org_tubepress_impl_util_TimeUtils::rfc3339toUnixTime('1980-11-03T09:03:33.000-05:00');
     $this->assertEquals('342108213', $result);
 }