<?php

namespace common\helpers;

class AppDateTimeHelper
{

    public static function convertMySqlDatetimeToPhpInteger($dateString){
        if (!isset($dateString)  || empty($dateString)){
            return null;
        }
        $unixTime = strtotime($dateString . " UTC");
        return $unixTime;
    }

     public static function convertUnixTimeToDateTime($unixTime){
            $result = new \DateTime();
            $result->setTimestamp($unixTime);
            $result->setTimeZone(new \DateTimeZone("UTC"));
            return $result;
        }

}
