You are here

public static function DateTimeHelper::convertUnixTimestampToDatetime in Content Planner 8

Convert unix timestamp to Datetime object.

Parameters

int $unix_timestamp:

Return value

\DateTime

2 calls to DateTimeHelper::convertUnixTimestampToDatetime()
CalendarController::updateNodePublishDate in modules/content_calendar/src/Controller/CalendarController.php
Update creation date of a given Node.
CalendarEntry::formatSchedulingDateAsMySQLDateOnly in modules/content_calendar/src/Component/CalendarEntry.php
Format creation date as MySQL Date only.

File

modules/content_calendar/src/DateTimeHelper.php, line 105

Class

DateTimeHelper

Namespace

Drupal\content_calendar

Code

public static function convertUnixTimestampToDatetime($unix_timestamp) {
  $datetime = new \DateTime();
  $datetime
    ->setTimestamp($unix_timestamp);
  return $datetime;
}