• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getDate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getDate函数的典型用法代码示例。如果您正苦于以下问题:PHP getDate函数的具体用法?PHP getDate怎么用?PHP getDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getDate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buildForm

 /**
  * Formulaire d'entité activité
  * @param $builder <i>FormBuilderInterface<i/> 
  * @param $options <i>Array</i> 
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $today = getDate();
     //$jour = $today['wday'];
     $annee = $today['year'];
     $builder->add('sportPratique', 'entity', array('label' => 'Sport', 'empty_value' => 'Sélectionnez un sport', 'class' => 'mooveActiviteBundle:Sport', 'property' => 'nom', 'multiple' => false, 'expanded' => false))->add('niveauRequis', 'entity', array('label' => 'Niveau conseillé', 'empty_value' => 'Sélectionez un niveau', 'class' => 'mooveActiviteBundle:Niveau', 'property' => 'libelle', 'multiple' => false, 'expanded' => false))->add('dateHeureRDV', 'datetime', array('label' => 'Date et heure de rendez-vous', 'years' => range($annee, $annee + 5)))->add('dateFermeture', 'datetime', array('label' => 'Date et heure de fermeture  de l\'activité', 'years' => range($annee, $annee + 5)))->add('duree', 'time', array('label' => 'Durée estimée'))->add('nbPlaces', 'integer', array('label' => 'Nombre de places total (vous inclus)'))->add('description', 'ckeditor', array('required' => false, 'label' => 'Informations', 'config_name' => 'config_description'))->add('adresseLieuRDV', 'text', array('constraints' => new Adresse()))->add('adresseLieuDepart', 'text', array('required' => false, 'constraints' => new Adresse()))->add('adresseLieuArrivee', 'text', array('required' => false, 'constraints' => new Adresse()));
 }
开发者ID:ARL64,项目名称:moove,代码行数:12,代码来源:ActiviteType.php


示例2: Calendar

 /**
  * Construct
  * 
  * @param $str_date Any String formatted date understood by strtotime()
  * @link http://www.php.net/manual/en/function.strtotime.php
  */
 function Calendar($str_date = 'now')
 {
     $this->time = strtotime($str_date);
     $this->date = getDate($this->time);
     // use current month and year if not supplied
     $month = $this->date['mon'];
     $year = $this->date['year'];
     // get the dates for the start of this month and next month
     // we don't worry about month=13 as mktime() will take care of this
     $this_month = getDate(mktime(0, 0, 0, $month, 1, $year));
     $next_month = getDate(mktime(0, 0, 0, $month + 1, 1, $year));
     // http://scripts.franciscocharrua.com/php-calendar.php
     $this->day = $this_month["mday"];
     $this->month = $this_month["mon"];
     $this->month_name = $this_month["month"];
     $this->year = $this_month["year"];
     $this->first_day_offset = $this_month["wday"];
     $this->days_count = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24));
     $this->days = array();
     // fill in days
     $week = 1;
     for ($i = 0; $i < $this->days_count + $this->first_day_offset; $i++) {
         if ($i < $this->first_day_offset) {
             $this->days[$week][] = null;
         } else {
             $this->days[$week][] = $i - $this->first_day_offset + 1;
         }
         if ($i % 7 == 6) {
             $week++;
         }
     }
     // localized day names
     $this->day_names = $this->_getFullDayNames();
 }
开发者ID:bb27792,项目名称:php-calendar-class,代码行数:40,代码来源:calendar.class.php


示例3: init

 /**
  * Initialize the Home Page
  *
  * Gather billing stats and account stats from the database, then assign those
  * stats to template variables.
  */
 function init()
 {
     parent::init();
     // Current month
     $now = getDate(time());
     $this->smarty->assign("month", $now['month']);
     // Invoice Summary
     $stats = outstanding_invoices_stats();
     $this->smarty->assign("os_invoices_count", $stats['count']);
     $this->smarty->assign("os_invoices_total", $stats['total']);
     $this->smarty->assign("os_invoices_count_past_due", $stats['count_past_due']);
     $this->smarty->assign("os_invoices_total_past_due", $stats['total_past_due']);
     $this->smarty->assign("os_invoices_count_past_due_30", $stats['count_past_due_30']);
     $this->smarty->assign("os_invoices_total_past_due_30", $stats['total_past_due_30']);
     // Payment Summary
     $stats = payments_stats();
     $this->smarty->assign("payments_count", $stats['count']);
     $this->smarty->assign("payments_total", $stats['total']);
     // Account Summary
     $active_accounts = count_all_AccountDBO("status='Active'");
     $inactive_accounts = count_all_AccountDBO("status='Inactive'");
     $pending_accounts = count_all_AccountDBO("status='Pending'");
     $total_accounts = $active_accounts + $inactive_accounts;
     $this->smarty->assign("active_accounts_count", $active_accounts);
     $this->smarty->assign("inactive_accounts_count", $inactive_accounts);
     $this->smarty->assign("pending_accounts_count", $pending_accounts);
     $this->smarty->assign("total_accounts", $total_accounts);
 }
开发者ID:carriercomm,项目名称:NeoBill,代码行数:34,代码来源:HomePage.class.php


示例4: getWTCdate

 function getWTCdate($value)
 {
     utc_timezone();
     // "Year and only year" (i.e. 1960) will be treated as HH SS by default
     if (strlen($value) == 4) {
         // Assume this is a year:
         $value = "Jan 1 " . $value;
     } else {
         if (preg_match("/\\d{4}\\-\\d{2}/", $value) === 1) {
             $value = $value . "-01";
         }
     }
     if (($timestamp = strtotime($value)) === false) {
         return false;
     } else {
         $date = getDate($timestamp);
         if ($date['year'] > $this->maxYear) {
             $this->maxYear = $date['year'];
         }
         if ($date['year'] < $this->minYear) {
             $this->minYear = $date['year'];
         }
         return date('Y-m-d\\TH:i:s\\Z', $timestamp);
     }
     reset_timezone();
 }
开发者ID:aaryani,项目名称:RD-Switchboard-Net,代码行数:26,代码来源:dates.php


示例5: tTimeFormat

 /**
  * timestamp转换成显示时间格式
  * @param $timestamp
  * @return unknown_type
  */
 public static function tTimeFormat($timestamp)
 {
     $curTime = time();
     $space = $curTime - $timestamp;
     //1分钟
     if ($space < 60) {
         $string = "刚刚";
         return $string;
     } elseif ($space < 3600) {
         //一小时前
         $string = floor($space / 60) . "分钟前";
         return $string;
     }
     $curtimeArray = getdate($curTime);
     $timeArray = getDate($timestamp);
     if ($curtimeArray['year'] == $timeArray['year']) {
         if ($curtimeArray['yday'] == $timeArray['yday']) {
             $format = "%H:%M";
             $string = strftime($format, $timestamp);
             return "今天 {$string}";
         } elseif ($curtimeArray['yday'] - 1 == $timeArray['yday']) {
             $format = "%H:%M";
             $string = strftime($format, $timestamp);
             return "昨天 {$string}";
         } else {
             $string = sprintf("%d月%d日 %02d:%02d", $timeArray['mon'], $timeArray['mday'], $timeArray['hours'], $timeArray['minutes']);
             return $string;
         }
     }
     $string = sprintf("%d年%d月%d日 %02d:%02d", $timeArray['year'], $timeArray['mon'], $timeArray['mday'], $timeArray['hours'], $timeArray['minutes']);
     return $string;
 }
开发者ID:nangong92t,项目名称:go_src,代码行数:37,代码来源:DateShower.php


示例6: __construct

 public function __construct(&$doorGets)
 {
     $this->doorGets = $doorGets;
     $time = time();
     $range = array('month');
     $limitMax = $time - 86400;
     $isUser = $doorGets->dbQA('_users_info', ' ORDER BY date_creation ASC LIMIT 1');
     if (!empty($isUser)) {
         $limitMax = (int) $isUser[0]['date_creation'];
     }
     //$limitMax = $time - (86400 * 30);
     $timeleft = $time - $limitMax;
     $hourLeft = ceil($timeleft / 3600);
     $dayLeft = ceil($timeleft / 86400);
     $monthLeft = ceil($timeleft / (86400 * 30));
     $yearLeft = ceil($timeleft / (86400 * 364));
     $final = 31;
     foreach ($range as $unit) {
         switch ($unit) {
             // case 'day':
             //     $final = $dayLeft;
             //     $timeAdd = 86400;
             //     break;
             case 'month':
                 $final = $monthLeft;
                 $timeAdd = 86400 * 31;
                 break;
                 // case 'year':
                 //     $final = $yearLeft;
                 //     $timeAdd = 86400 * 364;
                 //     break;
         }
         for ($i = 0; $i <= $final; $i++) {
             $timeStart = $time - $i * $timeAdd;
             $date = getDate($timeStart);
             $dateFormat = $date['year'] . '-' . $date['mon'] . '-' . $date['mday'];
             $timeEnd = $time - ($i + 1) * $timeAdd;
             $dateEnd = getDate($timeEnd);
             $dateEndFormat = $dateEnd['year'] . '-' . $dateEnd['mon'] . '-' . $dateEnd['mday'];
             $start = strtotime($dateFormat . ' 23:59:59');
             $end = strtotime($dateEndFormat . ' 23:59:59');
             if ($unit === 'day') {
                 $dateFormat = GetDate::in($start, 2, $this->doorGets->myLanguage);
             } elseif ($unit === 'year') {
                 $dateFormat = ' ' . $date['year'];
             } else {
                 $dateFormat = $date['mon'] . '-' . $date['year'];
             }
             $this->data['accounts'][$unit]["{$dateFormat}"] = $this->getAccounts($start, $end);
             //$this->data['orders'][$unit]["$dateFormat"] = $this->getOrders($start,$end);
             $this->data['comments'][$unit]["{$dateFormat}"] = $this->getComments($start, $end);
             //$this->data['carts'][$unit]["$dateFormat"] = $this->getCarts($start,$end);
             $this->data['contributions'][$unit]["{$dateFormat}"] = $this->getContributions($start, $end);
             $this->data['tickets'][$unit]["{$dateFormat}"] = $this->getTickets($start, $end);
             $this->data['cloud'][$unit]["{$dateFormat}"] = $this->getCloud($start, $end);
         }
         $this->data['accounts'][$unit] = array_reverse($this->data['accounts'][$unit]);
     }
 }
开发者ID:doorgets,项目名称:cms,代码行数:59,代码来源:StatsService.php


示例7: GetFormatDate

 protected function GetFormatDate($date = null)
 {
     $dtn = null;
     if (!isset($date)) {
         $dtn = getDate();
     } else {
         $dtn = date('Y-m-d', $date / 1000);
     }
     return array($dtn['year'], $dtn['mday'], $dtn['mon'], 0, 0, 0);
 }
开发者ID:handledeck,项目名称:rup-ssau,代码行数:10,代码来源:HomeController.php


示例8: run

 public function run()
 {
     if ($this->sectionId !== null && isset($_POST['eventsCalendarWidgetDate']) && (!isset($_POST['eventsCalendarWidgetSectionId']) || $_POST['eventsCalendarWidgetSectionId'] != $this->sectionId)) {
         return;
     }
     Yii::app()->clientScript->registerCssFile(Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('event.assets'), false, -1, YII_DEBUG) . '/css/events-calendar-widget.css');
     if (Yii::app()->request->isAjaxRequest && isset($_POST['eventsCalendarWidgetDate'])) {
         $date = getdate(strtotime($_POST['eventsCalendarWidgetDate']));
     } else {
         $date = getdate();
     }
     $dateSqlStart = $date['year'] . '-' . str_pad($date['mon'], 2, '0', STR_PAD_LEFT) . '-01';
     $nextMonth = getDate(mktime(0, 0, 0, $date['mon'] + 1, 1, $date['year']));
     $dateSqlEnd = $date['year'] . '-' . str_pad($nextMonth['mon'], 2, '0', STR_PAD_LEFT) . '-01';
     if ($this->sectionId !== null) {
         $eventModels = Event::model()->findAll(array('condition' => 't.date_start < :dateend AND t.date_end >= :datestart AND t.section_id = :sectionId', 'params' => array(':datestart' => $dateSqlStart, ':dateend' => $dateSqlEnd, ':sectionId' => $this->sectionId)));
     } else {
         $eventModels = Event::model()->findAll(array('condition' => 't.date_start < :dateend AND t.date_end >= :datestart', 'params' => array(':datestart' => $dateSqlStart, ':dateend' => $dateSqlEnd)));
     }
     $events = array();
     foreach ($eventModels as $eventModel) {
         $monthStart = substr($eventModel->date_start, 5, 2);
         $yearStart = substr($eventModel->date_start, 0, 4);
         $dayStart = substr($eventModel->date_start, 8, 2);
         $dayEnd = substr($eventModel->date_end, 8, 2);
         $monthEnd = substr($eventModel->date_end, 5, 2);
         $yearEnd = substr($eventModel->date_end, 0, 4);
         if ($monthStart == $monthEnd && $yearStart == $yearEnd) {
             $dayEnd = substr($eventModel->date_end, 8, 2);
         } elseif (($monthStart < $monthEnd || $yearStart < $yearEnd) && ($date['mon'] == $monthEnd && $date['year'] == $yearEnd)) {
             $dayStart = 1;
         } elseif (($monthStart < $monthEnd || $yearStart < $yearEnd) && ($date['mon'] == $monthStart && $date['year'] == $yearStart)) {
             $dayEnd = 31;
         } else {
             $dayStart = 1;
             $dayEnd = 31;
         }
         for ($i = (int) $dayStart; $i <= $dayEnd; $i++) {
             if (!isset($events[$i])) {
                 $events[$i] = array();
             }
             $events[$i][] = $eventModel;
         }
     }
     $render = $this->render('eventsCalendarWidget', array('events' => $events, 'date' => $date), true);
     if (Yii::app()->request->isAjaxRequest) {
         echo "\n" . '<div id="events-calendar-widget-render">' . "\n";
         echo $render;
         echo "\n" . '</div>' . "\n";
         Yii::app()->end();
     } else {
         echo $render;
     }
 }
开发者ID:kostya1017,项目名称:our,代码行数:54,代码来源:EventsCalendarWidget.php


示例9: getBinary

 /** Gets the DBF file as a binary string
  * @see DBF::write()
  * @return string a binary string containing the DBF file.
  */
 public static function getBinary(array $schema, array $records, $pDate, $ismemofile)
 {
     if (is_numeric($pDate)) {
         $date = getDate($pDate);
     } elseif ($pDate == null) {
         $date = getDate();
     } else {
         $date = $pDate;
     }
     return self::makeHeader($date, $schema, $records, $ismemofile) . self::makeSchema($schema) . self::makeRecords($schema, $records);
 }
开发者ID:Apoooorv,项目名称:DBFProject,代码行数:15,代码来源:DBF.class.php


示例10: getWhatDay

 /**
  * @param bool $inFullName
  * @return mixed
  */
 public function getWhatDay($inFullName = true)
 {
     $typeKey = 'full';
     if ($inFullName != true) {
         $typeKey = 'abbr';
     }
     $this->dateInfoArray = @getDate();
     $weekday = $this->dateInfoArray[self::KEY_WEEKDAY];
     //曜日
     return static::$nameOfhDays[$weekday][$typeKey];
 }
开发者ID:takeohman,项目名称:sparelibs-PHP,代码行数:15,代码来源:DateTimeUtil_EN.class.php


示例11: get_server_time

function get_server_time()
{
    $now = getDate();
    if ($now["minutes"] < 10) {
        $now["minutes"] = "0" . $now["minutes"];
    }
    if ($now["seconds"] < 10) {
        $now["seconds"] = "0" . $now["seconds"];
    }
    echo $now["minutes"] . " " . $now["seconds"];
}
开发者ID:spaceregents,项目名称:spaceregents,代码行数:11,代码来源:map_getinfo.php


示例12: onLoad

 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->isPostBack) {
         $date = getDate();
         if (Prado::getApplication()->getSession()->contains('nonWorkingDayYear')) {
             $this->until->setTimeStamp(mktime(0, 0, 0, 1, 1, $this->Session['nonWorkingDayYear']));
             $this->from->setTimeStamp(mktime(0, 0, 0, 1, 1, $this->Session['nonWorkingDayYear']));
         } else {
             $this->until->setTimeStamp(mktime(0, 0, 0, 1, 1, $date['year']));
             $this->from->setTimeStamp(mktime(0, 0, 0, 1, 1, $date['year']));
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:14,代码来源:add.php


示例13: creatOrg

 function creatOrg($org = null)
 {
     $this->org = $org;
     $basepath = '/millersville/services/csil/organizations/profiles';
     $sysname = $this->cleanAssetName($this->org['orgname']);
     # Setup the structured data.
     $this->_setupOfficerArray($this->org['officers']);
     $this->_setupAdvisorArray($this->org['advisors']);
     # Prepare the selected categories.
     $temp = '';
     if ($this->org['category']) {
         foreach ($this->org['category'] as $cat) {
             $temp .= '::CONTENT-XML-SELECTOR::' . str_replace('&', 'and', $cat);
         }
     }
     $this->org['category'] = $temp;
     $this->sData[] = array('type' => 'group', 'identifier' => 'about', 'structuredDataNodes' => array('structuredDataNode' => array(array('type' => 'text', 'identifier' => 'purpose', 'text' => $this->org['purpose']), array('type' => 'text', 'identifier' => 'category', 'text' => $this->org['category']), array('type' => 'text', 'identifier' => 'website', 'text' => $this->org['website'] != 'http://' ? $this->org['website'] : ''), array('type' => 'text', 'identifier' => 'displayWebsite', 'text' => $this->org['confidential'] == 'Y' ? 'Yes' : 'No'), array('type' => 'text', 'identifier' => 'numMembers', 'text' => $this->org['nummembers']), array('type' => 'group', 'identifier' => 'meetings', 'structuredDataNodes' => array('structuredDataNode' => array(array('type' => 'text', 'identifier' => 'day', 'text' => $this->org['day']), array('type' => 'text', 'identifier' => 'time', 'text' => $this->org['time']), array('type' => 'text', 'identifier' => 'location', 'text' => $this->org['location'])))))));
     # Find the expiration date and folder.
     #
     # If the Month is after August, the expiration date needs to be the next year
     # If the Month is August and the Day is greater than 20, the experiation date needs to be the next year
     # If the Month is before August or August 20th, the expiration date needs to be the current year
     #
     $currentDate = getDate();
     if ($currentDate['mon'] > 8 || $currentDate['mon'] == 8 && $currentDate['mday'] > 20) {
         $expirationDate = mktime(0, 0, 0, 8, 20, $currentDate['year'] + 1);
         $expirationFolder = $basepath . '/archived/' . $currentDate['year'] . '_' . ($currentDate['year'] + 1);
     } else {
         $expirationDate = mktime(0, 0, 0, 8, 20, $currentDate['year']);
         $expirationFolder = $basepath . '/archived/' . ($currentDate['year'] - 1) . '_' . $currentDate['year'];
     }
     //echo $expirationFolder;
     # Check to be sure the archived folder exists (i.e. archives/YYYY).
     #	If not, create the folder.
     if (!$this->isAssetAlreadyCreated($expirationFolder, 'folder')) {
         # Create the root public folder
         $data = array('system-name' => str_replace($basepath . '/archived/', '', $expirationFolder), 'path' => $basepath . '/archived', 'indexable' => 0, 'publishable' => 0);
         if (!$this->createFolder($data)) {
             return false;
         }
     }
     # Create the page.
     $data = array('name' => $sysname, 'parentFolderPath' => $basepath . '/pending', 'shouldBePublished' => true, 'shouldBeIndexed' => true, 'expirationFolderPath' => $expirationFolder, 'metadata' => array('displayName' => $this->org['orgname'], 'title' => $this->org['orgname'], 'endDate' => $expirationDate), 'contentTypeId' => '5d9f032c7f000001000225f08612c787', 'structuredData' => array('structuredDataNodes' => array('structuredDataNode' => $this->sData)));
     if (!$this->createPage($data)) {
         return false;
     }
     unset($data);
     return true;
 }
开发者ID:rgriffith,项目名称:Cascade-WebServices,代码行数:49,代码来源:WEStudentOrg.php


示例14: publishNewHood

 public function publishNewHood($hood)
 {
     $today = getDate();
     $hood['date'] = $today['year'] . "-" . $today['mon'] . "-" . $today['mday'];
     $hood['time'] = $today['hours'] . ":" . $today['minutes'] . ":" . $today['seconds'];
     if (strlen($hood['text']) <= 500 && strlen($hood['text']) >= 1) {
         $idHood = $this->hood_model->insertNewHood($hood);
         $data['idHood'] = $idHood[0];
         echo $this->session->userdata('id');
     } else {
         $data['error'] = 'Error el Hood debe contener entre 1 - 500 caracteres';
         $data['main_content'] = '';
         $this->load->view('includes/template', $data);
     }
 }
开发者ID:rvega1204,项目名称:hood,代码行数:15,代码来源:hood.php


示例15: __construct

 /**
  *
  * @param array $files Data table containing the name of data files
  * @param array $datas Data table containing picked datas
  * @param string $context_datas Will be written in the log files.
  * @throws Exception Both arrays must have the same size.
  */
 public function __construct($storage_directory, $datas, $context_datas)
 {
     $this->storage_directory = $storage_directory;
     $this->week_suffix = "." . date("y") . '\'' . date("W");
     $this->date = getDate();
     $this->context_datas = $context_datas;
     $this->files = array();
     $this->data_file_name = $this->storage_directory . $this->data_file_name;
     $this->datas = array();
     foreach ($datas as $index => $data) {
         $this->files[] = $this->storage_directory . $index;
         $this->datas[] = $data;
     }
     $this->updateLogFiles();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:22,代码来源:BoomerangDatasProcessor.Class.php


示例16: get_festivos

function get_festivos($anio)
{
    global $festivos;
    global $festivos_tmp;
    festivo_religioso(pascua($anio), 'Jueves Santo', 0);
    festivo_religioso(pascua($anio), 'Viernes Santo', 0);
    festivo_religioso(pascua($anio), 'Asension', 1);
    festivo_religioso(pascua($anio), 'Corpus Cristi', 1);
    festivo_religioso(pascua($anio), 'Sagrado Corazon', 1);
    for ($i = 1; $i <= 12; $i++) {
        $this_month = getDate(mktime(0, 0, 0, $i, 1, $anio));
        $next_month = getDate(mktime(0, 0, 0, $i + 1, 1, $anio));
        $days = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24));
        for ($i_day = 1; $i_day <= $days; $i_day++) {
            $festivo = date("w", mktime(0, 0, 0, $i, $i_day, $anio));
            if ($festivo == 0 || $festivo == 6) {
                $festivo_month = $festivos[$i];
                array_push($festivo_month, $i_day);
                $festivos[$i] = $festivo_month;
            }
            $fiesta_tmp = $festivos_tmp[$i];
            foreach ($fiesta_tmp as $fiesta) {
                if ($fiesta == $i_day) {
                    $festivo_mov = date("w", mktime(0, 0, 0, $i, $i_day, $anio));
                    $festivo_month = $festivos[$i];
                    if ($festivo_mov != 1) {
                        $num = sig_lunes($festivo_mov);
                        $festivo_new = date("Y-m-d", mktime(0, 0, 0, $i, $i_day, $anio) + $num * 24 * 60 * 60);
                        list($f_anio, $f_mes, $f_dia) = parte_fecha($festivo_new);
                        if (substr($f_mes, 0, 1) == 0) {
                            $f_mes = substr($f_mes, 1, 2);
                        }
                        if (substr($f_dia, 0, 1) == 0) {
                            $f_dia = substr($f_dia, 1, 2);
                        }
                        $festivo_month = $festivos[$f_mes];
                        array_push($festivo_month, $f_dia);
                        $festivos[$f_mes] = $festivo_month;
                    } else {
                        array_push($festivo_month, $i_day);
                        $festivos[$i] = $festivo_month;
                    }
                }
            }
        }
    }
}
开发者ID:kractos26,项目名称:orfeo,代码行数:47,代码来源:func_date.inc.php


示例17: XoopsFormDateTime

 function XoopsFormDateTime($caption, $name, $size = 15, $value = 0)
 {
     $this->XoopsFormElementTray($caption, '&nbsp;');
     $value = intval($value);
     $this->addElement(new XoopsFormTextDateSelect('', $name . '[date]', $size, $value));
     $timearray = array();
     for ($i = 0; $i < 24; $i++) {
         for ($j = 0; $j < 60; $j = $j + 10) {
             $key = $i * 3600 + $j * 60;
             $timearray[$key] = $j != 0 ? $i . ':' . $j : $i . ':0' . $j;
         }
     }
     ksort($timearray);
     $datetime = $value > 0 ? getDate($value) : getdate(time());
     $timeselect = new XoopsFormSelect('', $name . '[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10));
     $timeselect->addOptionArray($timearray);
     $this->addElement($timeselect);
 }
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:18,代码来源:formdatetime.php


示例18: __construct

 public function __construct(&$doorGets)
 {
     $this->doorGets = $doorGets;
     $this->total['paid'] = $this->getTotalAmountPaid();
     $this->total['cancel'] = $this->getTotalAmountCancel();
     $this->total['waiting'] = $this->getTotalAmountWaiting();
     $this->total['profit'] = $this->getTotalAmountProfit();
     $time = time();
     $dateToday = getDate($time);
     $dateTodayFormat = $dateToday['year'] . '-' . $dateToday['mon'] . '-' . $dateToday['mday'];
     $startToday = strtotime($dateTodayFormat . ' 00:00:01');
     $endToday = strtotime($dateTodayFormat . ' 23:59:59');
     $this->today['paid'] = $this->getAmountPaidByDate($startToday, $endToday);
     $this->today['cancel'] = $this->getAmountCancelByDate($startToday, $endToday);
     $this->today['waiting'] = $this->getAmountWaitingByDate($startToday, $endToday);
     $this->today['profit'] = $this->getAmountProfitByDate($startToday, $endToday);
     $timeYesterday = $startToday - 10;
     $dateYesterday = getDate($timeYesterday);
     $dateYesterdayFormat = $dateYesterday['year'] . '-' . $dateYesterday['mon'] . '-' . $dateYesterday['mday'];
     $startYesterday = strtotime($dateYesterdayFormat . ' 00:00:01');
     $endYesterday = strtotime($dateYesterdayFormat . ' 23:59:59');
     $this->yesterday['paid'] = $this->getAmountPaidByDate($startYesterday, $endYesterday);
     $this->yesterday['cancel'] = $this->getAmountCancelByDate($startYesterday, $endYesterday);
     $this->yesterday['waiting'] = $this->getAmountWaitingByDate($startYesterday, $endYesterday);
     $this->yesterday['profit'] = $this->getAmountProfitByDate($startYesterday, $endYesterday);
     $timeWeek = $startToday - 604800;
     $dateWeek = getDate($timeWeek);
     $dateWeekFormat = $dateWeek['year'] . '-' . $dateWeek['mon'] . '-' . $dateWeek['mday'];
     $startWeek = strtotime($dateWeekFormat . ' 00:00:01');
     $endWeek = $endToday;
     $this->week['paid'] = $this->getAmountPaidByDate($startWeek, $endWeek);
     $this->week['cancel'] = $this->getAmountCancelByDate($startWeek, $endWeek);
     $this->week['waiting'] = $this->getAmountWaitingByDate($startWeek, $endWeek);
     $this->week['profit'] = $this->getAmountProfitByDate($startWeek, $endWeek);
     $timeMonth = $startToday - 2592000;
     $dateMonth = getDate($timeMonth);
     $dateMonthFormat = $dateMonth['year'] . '-' . $dateMonth['mon'] . '-' . $dateMonth['mday'];
     $startMonth = strtotime($dateMonthFormat . ' 00:00:01');
     $endMonth = $endToday;
     $this->month['paid'] = $this->getAmountPaidByDate($startMonth, $endMonth);
     $this->month['cancel'] = $this->getAmountCancelByDate($startMonth, $endMonth);
     $this->month['waiting'] = $this->getAmountWaitingByDate($startMonth, $endMonth);
     $this->month['profit'] = $this->getAmountProfitByDate($startMonth, $endMonth);
 }
开发者ID:doorgets,项目名称:cms,代码行数:44,代码来源:OrderService.php


示例19: init

 /**
  * Initialize Billing Page
  *
  * Gather billing statistics from the database and assign them to template variables
  */
 function init()
 {
     parent::init();
     // Current month
     $now = getDate(time());
     $this->smarty->assign("month", $now['month']);
     // Invoice Summary
     $stats = outstanding_invoices_stats();
     $this->smarty->assign("os_invoices_count", $stats['count']);
     $this->smarty->assign("os_invoices_total", $stats['total']);
     $this->smarty->assign("os_invoices_count_past_due", $stats['count_past_due']);
     $this->smarty->assign("os_invoices_total_past_due", $stats['total_past_due']);
     $this->smarty->assign("os_invoices_count_past_due_30", $stats['count_past_due_30']);
     $this->smarty->assign("os_invoices_total_past_due_30", $stats['total_past_due_30']);
     // Payment Summary
     $stats = payments_stats();
     $this->smarty->assign("payments_count", $stats['count']);
     $this->smarty->assign("payments_total", $stats['total']);
 }
开发者ID:carriercomm,项目名称:NeoBill,代码行数:24,代码来源:BillingPage.class.php


示例20: __construct

 function __construct($caption, $name, $size = 15, $value = 0)
 {
     parent::__construct($caption, '&nbsp;');
     $value = intval($value);
     $value = $value > 0 ? $value : time();
     $datetime = getDate($value);
     $this->addElement(new Xmf_Form_Element_Text_DateSelect('', $name . '[date]', $size, $value));
     $timearray = array();
     for ($i = 0; $i < 24; $i++) {
         for ($j = 0; $j < 60; $j = $j + 10) {
             $key = $i * 3600 + $j * 60;
             $timearray[$key] = $j != 0 ? $i . ':' . $j : $i . ':0' . $j;
         }
     }
     ksort($timearray);
     $timeselect = new Xmf_Form_Element_Select('', $name . '[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10));
     $timeselect->addOptionArray($timearray);
     $this->addElement($timeselect);
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:19,代码来源:Datetime.php



注:本文中的getDate函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getDateFormat函数代码示例发布时间:2022-05-15
下一篇:
PHP getDatabaseConnection函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap