Braintree\Xml\Generator::_castDateTime PHP Method

_castDateTime() private static method

private static _castDateTime ( $string )
    private static function _castDateTime($string)
    {
        try {
            if (empty($string)) {
                return false;
            }
            $dateTime = new DateTime($string);
            return self::_dateTimeToXmlTimestamp($dateTime);
        } catch (Exception $e) {
            // not a datetime
            return false;
        }
    }