public function CircleCiManager::formatCircleCiDateTime in Build Hooks 8.2
Same name and namespace in other branches
- 3.x modules/build_hooks_circleci/src/CircleCiManager.php \Drupal\build_hooks_circleci\CircleCiManager::formatCircleCiDateTime()
Converts the datetime format into a drupal formatted date.
Parameters
string $datetime: Date in the format returned by the CircleCi api.
Return value
string Drupal formatted date.
Overrides CircleCiManagerInterface::formatCircleCiDateTime
File
- modules/
build_hooks_circleci/ src/ CircleCiManager.php, line 153
Class
- CircleCiManager
- Class CircleCiManager.
Namespace
Drupal\build_hooks_circleciCode
public function formatCircleCiDateTime($datetime) {
// Dates are in UTC format:
$timezone = new \DateTimeZone('UTC');
$date = \DateTime::createFromFormat(self::CIRCLE_CI_DATE_FORMAT, $datetime, $timezone);
return $this->dateFormatter
->format($date
->getTimestamp(), 'long');
}