You are here

public static function BrightcoveUtil::convertDate in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/BrightcoveUtil.php \Drupal\brightcove\BrightcoveUtil::convertDate()
  2. 3.x src/BrightcoveUtil.php \Drupal\brightcove\BrightcoveUtil::convertDate()

Convert Brightcove date make it digestible by Drupal.

Parameters

string $brightcove_date: Brightcove date format.

Return value

string|null Drupal date format.

1 call to BrightcoveUtil::convertDate()
BrightcoveVideo::createOrUpdate in src/Entity/BrightcoveVideo.php
Create or update an existing video from a Brightcove Video object.

File

src/BrightcoveUtil.php, line 61

Class

BrightcoveUtil
Utility class for Brightcove.

Namespace

Drupal\brightcove

Code

public static function convertDate($brightcove_date) {
  if (empty($brightcove_date)) {
    return NULL;
  }
  return preg_replace('/\\.\\d{3}Z$/i', '', $brightcove_date);
}