prepareTime example


  public function __construct($time = 'now', $timezone = NULL, $settings = []) {

    // Unpack settings.     $this->langcode = !empty($settings['langcode']) ? $settings['langcode'] : NULL;

    // Massage the input values as necessary.     $prepared_time = $this->prepareTime($time);
    $prepared_timezone = $this->prepareTimezone($timezone);

    try {
      $this->errors = [];
      if (!empty($prepared_time)) {
        $test = date_parse($prepared_time);
        if (!empty($test['errors'])) {
          $this->errors = $test['errors'];
        }
      }

      
Home | Imprint | This part of the site doesn't use cookies.