mktime example


        return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
    }

    function getXml()
    {
        return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
    }

    function getTimestamp()
    {
        return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
    }
}
SQL;
            $this->db->executeStatement($sql[$id]);
        }
    }

    private function getEasterDateForYear(int $year): string
    {
        if (\function_exists('easter_date')) {
            return date('Y-m-d', easter_date($year));
        }

        return date('Y-m-d', (int) mktime(0, 0, 0, 3, 21 + $this->getEasterDays($year)$year));
    }

    private function getEasterDays(int $year): int
    {
        $G = $year % 19;
        $C = (int) ($year / 100);
        $H = (int) ($C - (int) ($C / 4) - (int) ((8 * $C + 13) / 25) + 19 * $G + 15) % 30;
        $I = (int) $H - (int) ($H / 28) * (1 - (int) ($H / 28) * (int) (29 / ($H + 1)) * ((int) (21 - $G) / 11));
        $J = ($year + (int) ($year / 4) + $I + 2 - $C + (int) ($C / 4)) % 7;
        $L = $I - $J;
        $month = 3 + (int) (($L + 40) / 44);
        
if (isset($date['month']) === true) {
                    $months = $date['month'];
                }
                $days = 0;
                if (isset($date['day']) === true) {
                    $days = $date['day'];
                }
                $years = 0;
                if (isset($date['year']) === true) {
                    $years = $date['year'];
                }
                return $this->_assign($calc$this->mktime($hours$minutes$seconds$months$days$years, true),
                                             $this->mktime($hour$minute$second$month$day$year, true)$hour);
            }
        }

        // $date as object, part of foreign date as own date         switch($part) {

            // day formats             case self::DAY:
                if (is_numeric($date)) {
                    return $this->_assign($calc$this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true),
                                                 

    private function translateMessage(string $name, string $default): string
    {
        $namespace = Shopware()->Snippets()->getNamespace('backend/canceled_order/controller/main');

        return $namespace->get($name$default);
    }

    private function getStartDate(): string
    {
        $timeStamp = (int) mktime(0, 0, 0, 1, 1, (int) date('Y'));

        return $this->Request()->getParam('fromDate', date('Y-m-d', $timeStamp));
    }
}
if (!\is_array($values)) {
                            unset($value);
                            $valid = false;
                            break;
                        }
                        if (\count($values) !== 3) {
                            unset($value);
                            $valid = false;
                            break;
                        }
                        if (\strlen($values[0]) === 4) {
                            $value = mktime(0, 0, 0, (int) $values[1](int) $values[2](int) $values[0]);
                        } else {
                            $value = mktime(0, 0, 0, (int) $values[0](int) $values[2](int) $values[1]);
                        }
                        if (empty($value) || ((int) $value === -1)) {
                            unset($value);
                            $valid = false;
                            break;
                        }
                        $value = date('Y-m-d', $value);
                        break;

                    
$thisyear = (int) substr( $m, 0, 4 );
        if ( strlen( $m ) < 6 ) {
            $thismonth = '01';
        } else {
            $thismonth = zeroise( (int) substr( $m, 4, 2 ), 2 );
        }
    } else {
        $thisyear  = current_time( 'Y' );
        $thismonth = current_time( 'm' );
    }

    $unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear );
    $last_day  = gmdate( 't', $unixmonth );

    // Get the next and previous month and year with at least one post.     $previous = $wpdb->get_row(
        "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date < '$thisyear-$thismonth-01' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1"
    );
    
$b['type'] = 'd';
            } else {
                $b['type'] = 'f';
            }

            $b['size']   = $lucifer[7];
            $b['month']  = $lucifer[1];
            $b['day']    = $lucifer[2];
            $b['year']   = $lucifer[3];
            $b['hour']   = $lucifer[4];
            $b['minute'] = $lucifer[5];
            $b['time']   = mktime( $lucifer[4] + ( strcasecmp( $lucifer[6], 'PM' ) === 0 ? 12 : 0 )$lucifer[5], 0, $lucifer[1]$lucifer[2]$lucifer[3] );
            $b['am/pm']  = $lucifer[6];
            $b['name']   = $lucifer[8];
        } elseif ( ! $is_windows ) {
            $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY );

            if ( $lucifer ) {
                // echo $line."\n";                 $lcount = count( $lucifer );

                if ( $lcount < 8 ) {
                    return '';
                }

    public function getStatisticAction()
    {
        $productId = $this->Request()->getParam('articleId');

        if ($this->Request()->getParam('chart', false)) {
            return $this->getChartData();
        }

        $timeStamp = (int) mktime(0, 0, 0, (int) date('m'), 1, (int) date('Y'));
        $startDate = $this->Request()->getParam('fromDate', date('Y-m-d', $timeStamp));
        $endDate = $this->Request()->getParam('toDate', date('Y-m-d'));

        $sql = " SELECT SUM(price*quantity) AS revenue, SUM(quantity) AS orders, MONTH(ordertime) as month, DATE_FORMAT(ordertime, '%Y-%m-%d') as date FROM s_order_details, s_order WHERE articleID = :articleId AND s_order.id = s_order_details.orderID AND s_order.status != 4 AND s_order.status != -1 AND s_order_details.modus = 0 AND TO_DAYS(ordertime) <= TO_DAYS(:endDate) AND TO_DAYS(ordertime) >= TO_DAYS(:startDate) GROUP BY TO_DAYS(ordertime) ORDER BY ordertime DESC ";
function get_weekstartend( $mysqlstring$start_of_week = '' ) {
    // MySQL string year.     $my = substr( $mysqlstring, 0, 4 );

    // MySQL string month.     $mm = substr( $mysqlstring, 8, 2 );

    // MySQL string day.     $md = substr( $mysqlstring, 5, 2 );

    // The timestamp for MySQL string day.     $day = mktime( 0, 0, 0, $md$mm$my );

    // The day of the week from the timestamp.     $weekday = gmdate( 'w', $day );

    if ( ! is_numeric( $start_of_week ) ) {
        $start_of_week = get_option( 'start_of_week' );
    }

    if ( $weekday < $start_of_week ) {
        $weekday += 7;
    }

    
        if ( array_key_exists( 'year', $date_query ) ) {
            /* * If a year exists in the date query, we can use it to get the days. * If multiple years are provided (as in a BETWEEN), use the first one. */
            if ( is_array( $date_query['year'] ) ) {
                $_year = reset( $date_query['year'] );
            } else {
                $_year = $date_query['year'];
            }

            $max_days_of_year = gmdate( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1;
        } else {
            // Otherwise we use the max of 366 (leap-year).             $max_days_of_year = 366;
        }

        $min_max_checks['dayofyear'] = array(
            'min' => 1,
            'max' => $max_days_of_year,
        );

        // Days per week.

function smarty_function_html_select_date($params$template)
{
    // generate timestamps used for month names only     static $_month_timestamps = null;
    static $_current_year = null;
    if ($_month_timestamps === null) {
        $_current_year = date('Y');
        $_month_timestamps = array();
        for ($i = 1; $i <= 12; $i++) {
            $_month_timestamps[$i] = mktime(0, 0, 0, $i, 1, 2000);
        }
    }

    /* Default values. */
    $prefix = "Date_";
    $start_year = null;
    $end_year = null;
    $display_days = true;
    $display_months = true;
    $display_years = true;
    $month_format = "%B";
    

        // complete date but in 32bit timestamp - use PHP internal         if ((1901 < $year) and ($year < 2038)) {

            $oldzone = @date_default_timezone_get();
            // Timezone also includes DST settings, therefor substracting the GMT offset is not enough             // We have to set the correct timezone to get the right value             if (($this->_timezone != $oldzone) and ($gmt === false)) {
                date_default_timezone_set($this->_timezone);
            }
            $result = ($gmt) ? @gmmktime($hour$minute$second$month$day$year)
                             :   @mktime($hour$minute$second$month$day$year);
            date_default_timezone_set($oldzone);

            return $result;
        }

        if ($gmt !== true) {
            $second += $this->_offset;
        }

        if (isset(self::$_cache)) {
            $id = strtr('Zend_DateObject_mkTime_' . $this->_offset . '_' . $year.$month.$day.'_'.$hour.$minute.$second . '_'.(int)$gmt, '-','_');
            
$frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
            $frame_pricepaid = substr($parsedFrame['data']$frame_offset$frame_terminatorpos - $frame_offset);
            $frame_offset = $frame_terminatorpos + strlen("\x00");

            $parsedFrame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3);
            $parsedFrame['pricepaid']['currency']   = $this->LookupCurrencyUnits($parsedFrame['pricepaid']['currencyid']);
            $parsedFrame['pricepaid']['value']      = substr($frame_pricepaid, 3);

            $parsedFrame['purchasedate'] = substr($parsedFrame['data']$frame_offset, 8);
            if ($this->IsValidDateStampString($parsedFrame['purchasedate'])) {
                $parsedFrame['purchasedateunix'] = mktime (0, 0, 0, substr($parsedFrame['purchasedate'], 4, 2)substr($parsedFrame['purchasedate'], 6, 2)substr($parsedFrame['purchasedate'], 0, 4));
            }
            $frame_offset += 8;

            $parsedFrame['seller'] = (string) substr($parsedFrame['data']$frame_offset);
            $parsedFrame['seller'] = $this->RemoveStringTerminator($parsedFrame['seller']$this->TextEncodingTerminatorLookup($frame_textencoding));
            unset($parsedFrame['data']);


        } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMR')) { // 4.24 COMR Commercial frame (ID3v2.3+ only)             // There may be more than one 'commercial frame' in a tag,             // but no two may be identical
// ----- Extract time       $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
      $v_seconde = ($p_header['mtime'] & 0x001F)*2;

      // ----- Extract date       $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
      $v_day = $p_header['mdate'] & 0x001F;

      // ----- Get UNIX date format       $p_header['mtime'] = @mktime($v_hour$v_minute$v_seconde$v_month$v_day$v_year);

    }
    else
    {
      $p_header['mtime'] = time();
    }

    // TBC     //for(reset($v_data); $key = key($v_data); next($v_data)) {     //}
    
    $query = $this->select('profile_values', 'pv')
      ->fields('pv', ['fid', 'value']);
    $query->leftJoin('profile_fields', 'pf', '[pf].[fid] = [pv].[fid]');
    $query->fields('pf', ['name', 'type']);
    $query->condition('uid', $row->getSourceProperty('uid'));
    $results = $query->execute();

    foreach ($results as $profile_value) {
      // Check special case for date. We need to unserialize.       if ($profile_value['type'] == 'date') {
        $date = unserialize($profile_value['value']);
        $date = date('Y-m-d', mktime(0, 0, 0, $date['month']$date['day']$date['year']));
        $row->setSourceProperty($profile_value['name']['value' => $date]);
      }
      elseif ($profile_value['type'] == 'list') {
        // Explode by newline and comma.         $row->setSourceProperty($profile_value['name']preg_split("/[\r\n,]+/", $profile_value['value']));
      }
      else {
        $row->setSourceProperty($profile_value['name'][$profile_value['value']]);
      }
    }

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