<?php

namespace ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Helpers;


use ModulesGarden\Servers\ZimbraEmail\App\Enums\ProductParams;
use ModulesGarden\Servers\ZimbraEmail\App\Enums\Size;

/**
 *
 * Created by PhpStorm.
 * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
 * 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;
        }
        $tmpDate = strstr($date, '.', true);
        $tmpDate = $tmpDate ? $tmpDate : $date;

        return date($format, strtotime($tmpDate));
    }
}