<?php

namespace ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Helpers;


use ThurData\Servers\KerioEmail\App\Enums\ProductParams;
use ThurData\Servers\KerioEmail\App\Enums\Size;

/**
 *
 * Created by PhpStorm.
 * User: ThurData
 * Date: 18.09.19
 * Time: 09:22
 * Class RessourceHelper
 */
class RessourceHelper
{

    /**
     * @description return formatted data per API data
     * @param $date
     * @return false|string|null
     */
    public static function getFormattedData($date, $format = 'd/m/Y')
    {
        if(!$date)
        {
            return null;
        }
        $mydate = new \DateTime("@$date", new \DateTimeZone('UTC'));
        $localTZ = (new \DateTime)->getTimezone();
        $mydate->setTimezone($localTZ);
        return $mydate->format($format);
    }
}