original_string: public static function parseDateTime($time, $format = null)
      {
          $dateFormat = $format ?: static::$_toStringFormat;
          $timeFormat = $pattern = null;
  
          if (is_array($dateFormat)) {
              list($newDateFormat, $timeFormat) = $dateFormat;
              $dateFormat = $newDateFormat;
          } else {
              $pattern = $dateFormat;
              $dateFormat = null;
          }
  
          if (static::$_isDateInstance === null) {
              static::$_isDateInstance =
                  is_subclass_of(static::class, ChronosDate::class) ||
                  is_subclass_of(static::class, MutableDate::class);
          }
  
          $defaultTimezone = static::$_isDateInstance ? 'UTC' : date_default_timezone_get();
          $formatter = datefmt_create(
              static::$defaultLocale,
              $dateFormat,
              $timeFormat,
              $defaultTimezone,
              null,
              $pattern
          );
          $time = $formatter->parse($time);
          if ($time !== false) {
              $result = new static('@' . $time);
  
              return static::$_isDateInstance ? $result : $result->setTimezone($defaultTimezone);
          }
  
          return null;
      }
code: public static function parseDateTime($time, $format = null)
      {
          $dateFormat = $format ?: static::$_toStringFormat;
          $timeFormat = $pattern = null;
  
          if (is_array($dateFormat)) {
              list($newDateFormat, $timeFormat) = $dateFormat;
              $dateFormat = $newDateFormat;
          } else {
              $pattern = $dateFormat;
              $dateFormat = null;
          }
  
          if (static::$_isDateInstance === null) {
              static::$_isDateInstance =
                  is_subclass_of(static::class, ChronosDate::class) ||
                  is_subclass_of(static::class, MutableDate::class);
          }
  
          $defaultTimezone = static::$_isDateInstance ? 'UTC' : date_default_timezone_get();
          $formatter = datefmt_create(
              static::$defaultLocale,
              $dateFormat,
              $timeFormat,
              $defaultTimezone,
              null,
              $pattern
          );
          $time = $formatter->parse($time);
          if ($time !== false) {
              $result = new static('@' . $time);
  
              return static::$_isDateInstance ? $result : $result->setTimezone($defaultTimezone);
          }
  
          return null;
      }
code_tokens: public static function parseDateTime ( $ time , $ format = null ) { $ dateFormat = $ format ? : static :: $ _toStringFormat ; $ timeFormat = $ pattern = null ; if ( is_array ( $ dateFormat ) ) { list ( $ newDateFormat , $ timeFormat ) = $ dateFormat ; $ dateFormat = $ newDateFormat ; } else { $ pattern = $ dateFormat ; $ dateFormat = null ; } if ( static :: $ _isDateInstance === null ) { static :: $ _isDateInstance = is_subclass_of ( static :: class , ChronosDate :: class ) || is_subclass_of ( static :: class , MutableDate :: class ) ; } $ defaultTimezone = static :: $ _isDateInstance ? 'UTC' : date_default_timezone_get ( ) ; $ formatter = datefmt_create ( static :: $ defaultLocale , $ dateFormat , $ timeFormat , $ defaultTimezone , null , $ pattern ) ; $ time = $ formatter -> parse ( $ time ) ; if ( $ time !== false ) { $ result = new static ( '@' . $ time ) ; return static :: $ _isDateInstance ? $ result : $ result -> setTimezone ( $ defaultTimezone ) ; } return null ; }
docstring: Returns a new Time object after parsing the provided time string based on
  the passed or configured date time format. This method is locale dependent,
  Any string that is passed to this function will be interpreted as a locale
  dependent string.
  
  When no $format is provided, the `toString` format will be used.
  
  If it was impossible to parse the provided time, null will be returned.
  
  Example:
  
  ```
  $time = Time::parseDateTime('10/13/2013 12:54am');
  $time = Time::parseDateTime('13 Oct, 2013 13:54', 'dd MMM, y H:mm');
  $time = Time::parseDateTime('10/10/2015', [IntlDateFormatter::SHORT, -1]);
  ```
  
  @param string $time The time string to parse.
  @param string|array|null $format Any format accepted by IntlDateFormatter.
  @return static|null
docstring_tokens: Returns a new Time object after parsing the provided time string based on the passed or configured date time format . This method is locale dependent Any string that is passed to this function will be interpreted as a locale dependent string .