You are here

protected function FeedsOAIHTTPFetcherResult::formatDate in Feeds OAI-PMH Fetcher and Parser 7

1 call to FeedsOAIHTTPFetcherResult::formatDate()
FeedsOAIHTTPFetcherResult::getRaw in ./FeedsOAIHTTPFetcher.inc
Implementation of FeedsResult::getRaw();

File

./FeedsOAIHTTPFetcher.inc, line 109

Class

FeedsOAIHTTPFetcherResult
Definition of the import batch object created on the fetching stage by FeedsOAIHTTPFetcher.

Code

protected function formatDate($timestamp) {
  $granularity = $this->repository['granularity'];
  if ('seconds' == $granularity) {
    $date_format = 'Y-m-d\\TH:m:s\\Z';
  }
  elseif ('days' == $granularity) {
    $date_format = 'Y-m-d';
  }
  return date($date_format, $timestamp);
}