You are here

function pmpapi_convert_timestamp in Public Media Platform API Integration 7

Converts a given timestamp to a localized PMP-friendly date.

Parameters

$timestamp int: A timestamp.

Return value

string A localized PMP-friendly date.

6 calls to pmpapi_convert_timestamp()
PMPAPIPullWebTestCase::testPmpAPIEmbargoedThenValid in pmpapi_pull/tests/pmpapi_pull.test
Checks that node is published when it becomes valid.
PMPAPIPullWebTestCase::testPmpAPIPullEmbargoedStory in pmpapi_pull/tests/pmpapi_pull.test
Checks for status = 0 on pulled embargoed story.
PMPAPIPullWebTestCase::testPmpAPIPullExpiredStory in pmpapi_pull/tests/pmpapi_pull.test
Checks for status = 0 on pulled expired story.
PMPAPIPullWebTestCase::testPmpAPIValidThenExpired in pmpapi_pull/tests/pmpapi_pull.test
Checks that node is unpublished when it becomes expired.
pmpapi_doc_is_valid in ./pmpapi.module
Determines if a given PMP doc is valid (i.e., not embargoed nor expired)

... See full list

File

./pmpapi.module, line 641
Creates basic calls to the PMP API.

Code

function pmpapi_convert_timestamp($timestamp = NULL) {
  if ($timestamp === NULL) {
    $timestamp = REQUEST_TIME;
  }
  return format_date($timestamp, 'custom', DateTime::ISO8601);
}