util/PropertyAccessor.php
public static function getSafeDateProperty(\stdClass $object, ...$properties)
    {
        $val = self::getSafeProperty($object, ...$properties);
        if ($val === null) {
            return null;
        }
        $val = preg_replace('/\.\d+/', '', $val);
        return new Carbon($val);
    }
public static function getSafeDateProperty(\stdClass $object, ...$properties)
    {
        $val = self::getSafeProperty($object, ...$properties);
        if ($val === null) {
            return null;
        }
        $val = preg_replace('/\.\d+/', '', $val);
        return new Carbon($val);
    }
public static function getSafeDateProperty ( \ stdClass $ object , ... $ properties ) { $ val = self :: getSafeProperty ( $ object , ... $ properties ) ; if ( $ val === null ) { return null ; } $ val = preg_replace ( '/\.\d+/' , '' , $ val ) ; return new Carbon ( $ val ) ; }
Returns a Carbon object for a given date time.
@param \stdClass $object
@param array ...$properties
@return Carbon|null
Returns a Carbon object for a given date time .