You are here

public function MoAuthApi::getTimeStamp in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

This function is used to get the timestamp value

1 call to MoAuthApi::getTimeStamp()
MoAuthApi::getHttpHeaderArray in src/Api/MoAuthApi.php

File

src/Api/MoAuthApi.php, line 22

Class

MoAuthApi

Namespace

Drupal\miniorange_saml\Api

Code

public function getTimeStamp() {
  $url = MiniorangeSAMLConstants::SERVER_TIME_API;
  $fields = array();
  $currentTimeInMillis = $this
    ->makeCurlCall($url, $fields);
  if (empty($currentTimeInMillis)) {
    $currentTimeInMillis = round(microtime(true) * 1000);
    $currentTimeInMillis = number_format($currentTimeInMillis, 0, '', '');
  }
  return $currentTimeInMillis;
}