当前位置: 首页>>代码示例>>PHP>>正文


PHP convert_date函数代码示例

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


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

示例1: parseUserInfo_user_regdate

 function parseUserInfo_user_regdate($val)
 {
     if (strstr($val, '-')) {
         return convert_date($val);
     } else {
         return convert_date(date('Y-m-d H:i:s', $val));
     }
 }
开发者ID:amenski,项目名称:BookSharing,代码行数:8,代码来源:bb_func_usernfo.php

示例2: viewfiledtranspo

 /**
  * View filed transpo request.
  */
 public function viewfiledtranspo()
 {
     $this->load->model(array('employees', 'transpoallowance'));
     $this->load->library(array('transport'));
     $this->load->helper(array('my_datetime_helper'));
     $this->transpoallowance->load($this->uri->segment(3));
     $this->employees->load($this->transpoallowance->EmployeeNumber);
     $data['transpoallowance'] = $this->transpoallowance;
     $data['employee'] = $this->employees;
     $data['coverage'] = $this->transport->transpo_coverage($this->transpoallowance->EmployeeNumber, convert_date($this->transpoallowance->Datefrom, "Y-m-d"), convert_date($this->transpoallowance->Dateto, "Y-m-d"));
     $this->load->view('transpohrapproval/viewfiledtranspo', $data);
 }
开发者ID:hfugen112678,项目名称:webforms,代码行数:15,代码来源:Transpohrapproval.php

示例3: new_demande

function new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $new_type, $DEBUG = FALSE)
{
    //conversion des dates
    $new_debut = convert_date($new_debut);
    $new_fin = convert_date($new_fin);
    // print_r($new_fin);
    //$new_nb_jours = get_nb_jour($new_debut, $new_fin, $new_demi_jour_deb, $new_demi_jour_fin);
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    // echo " $new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $new_type<br><br>\n";
    // exit;
    // verif validité des valeurs saisies
    $valid = verif_saisie_new_demande($new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment);
    // verifie que le solde de conges sera encore positif après validation
    if ($_SESSION['config']['solde_toujours_positif']) {
        $valid = $valid && verif_solde_user($_SESSION['userlogin'], $new_type, $new_nb_jours, $DEBUG);
    }
    if ($valid) {
        if (in_array(get_type_abs($new_type, $DEBUG), array('conges', 'conges_exceptionnels'))) {
            $new_etat = 'demande';
        } else {
            $new_etat = 'ok';
        }
        $new_comment = addslashes($new_comment);
        $periode_num = insert_dans_periode($_SESSION['userlogin'], $new_debut, $new_demi_jour_deb, $new_fin, $new_demi_jour_fin, $new_nb_jours, $new_comment, $new_type, $new_etat, 0, $DEBUG);
        if ($periode_num != 0) {
            echo schars(_('form_modif_ok')) . ' !<br><br>' . "\n";
            //envoi d'un mail d'alerte au responsable (si demandé dans config de php_conges)
            if ($_SESSION['config']['mail_new_demande_alerte_resp']) {
                alerte_mail($_SESSION['userlogin'], ":responsable:", $periode_num, "new_demande", $DEBUG);
            }
        } else {
            echo schars(_('form_modif_not_ok')) . ' !<br><br>' . "\n";
        }
    } else {
        echo schars(_('resp_traite_user_valeurs_not_ok')) . ' !<br><br>' . "\n";
    }
    /* RETOUR PAGE PRINCIPALE */
    // echo '<form action="'.$PHP_SELF.'?session='.$session.'" method="POST">';
    // echo '<input type="submit" value="'. _('form_retour') .'">';
    // echo '</form>';
    echo "<a class=\"btn\" href=\"{$PHP_SELF}?session={$session}\">" . _('form_retour') . "</a>\n";
}
开发者ID:coz787,项目名称:Libertempo,代码行数:43,代码来源:user_nouvelle_absence.php

示例4: sick_leaves

 /**
  * Retrieve list of sick leaves that may or may not require medical 
  * certificates.
  * 
  * @param date $datefrom
  * @param date $dateto
  * @return string
  */
 public function sick_leaves($start = NULL, $end = NULL)
 {
     // If date parameters are empty set it to the current date.
     $sdate = iif(isset($start), $start, date('Y-m-d'));
     $edate = iif(isset($end), $end, date('Y-m-d'));
     $empty[] = array('No results found.', '', '', '', '', '', '');
     $params = array('header' => $this->_tableheaders, 'class' => array('table table-striped table-bordered dt-table'));
     $this->_ci->load->library('MY_table', $params, 'medcerts');
     $sickleaves = $this->_ci->employeeleavesfiled->medcerts($sdate, $edate);
     if (isset($sickleaves) && !empty($sickleaves)) {
         for ($i = 0; $i < count($sickleaves); $i++) {
             $tabledata[] = array(convert_date($sickleaves[$i]->DateFiled, 'M d, Y'), $sickleaves[$i]->Name, convert_date($sickleaves[$i]->LeaveFrom, 'M d, Y'), convert_date($sickleaves[$i]->LeaveTo, 'M d, Y'), $sickleaves[$i]->LeaveCount, leave_status($sickleaves[$i]), $this->_check_medcert($sickleaves[$i]->WithMedCert, $sickleaves[$i]->LeaveID));
         }
         if (isset($tabledata) && !empty($tabledata)) {
             return $this->_ci->medcerts->generate($tabledata);
         } else {
             return $this->_ci->medcerts->generate($empty);
         }
     } else {
         return $this->_ci->medcerts->generate($empty);
     }
 }
开发者ID:hfugen112678,项目名称:webforms,代码行数:30,代码来源:Medcert.php

示例5: maketable

function maketable($result, $fields)
{
    $num_papers = mysqli_num_rows($result);
    if ($num_papers != 0) {
        echo "<table class='papersTable'>";
        //var_dump($fields);
        //$fields = ["name", "filename", "author", "subject", "time"];
        echo "<tr>";
        for ($i = 0; $i < count($fields); $i++) {
            echo "<th>";
            echo $fields[$i];
            echo "</th>";
        }
        echo "</tr>";
        for ($i = 0; $i < $num_papers; $i++) {
            $row = mysqli_fetch_assoc($result);
            echo "<tr>";
            foreach ($fields as $key) {
                $val = $row[$key];
                if (!in_array($key, $fields)) {
                    continue;
                }
                if ($key == "time") {
                    $val = convert_date($val);
                }
                if ($key == "filename") {
                    $val = "<a href='../papers/{$val}'>{$val}</a>";
                    $val = substr($val, 0, strrpos($val, '_'));
                }
                echo "<td style= 'padding: 0px 10px;'>{$val}</td>";
            }
            unset($val);
            echo "</tr>";
            //var_dump($rows[$i]);
        }
        echo "</table>";
    }
}
开发者ID:ajspencer,项目名称:Broad-Street-Scientific,代码行数:38,代码来源:dateconvert.php

示例6: update

 /**
  * Approve/ decline leave.
  */
 public function update()
 {
     $this->load->model(array('employeeleavesfiled', 'employeeleaves', 'leavetype'));
     $this->load->library('leave');
     $this->load->helper(array('my_datetime_helper'));
     $this->leavetype->Remarks = $this->db->escape($this->input->post('leavetype'));
     $type = $this->leavetype->get();
     $this->employeeleavesfiled->EmployeeNumber = $this->input->post('employeenumber');
     $this->employeeleavesfiled->LeaveFrom = convert_date($this->input->post('leavefrom'), 'Y-m-d H:i:s');
     $this->employeeleavesfiled->LeaveTo = convert_date($this->input->post('leaveto'), 'Y-m-d H:i:s');
     $this->employeeleavesfiled->LeaveCount = $this->input->post('count');
     $this->employeeleavesfiled->Type = $type[0]->LeaveType;
     $this->employeeleavesfiled->Reason = $this->input->post('leavereason');
     $this->employeeleavesfiled->Deleted = $this->input->post('status');
     $this->employeeleavesfiled->WithPay = $this->input->post('withpay');
     $this->employeeleavesfiled->AuditUser = '123456';
     $this->employeeleavesfiled->AuditDate = date('Y-m-d H:i:s');
     $this->employeeleavesfiled->update($this->input->post('leaveid'));
     // Update leave credits
     // Leave is approved
     if ($this->input->post('status') == 0) {
         // Leave is with pay.
         if ($this->input->post('withpay') == 1) {
             $this->employees->load($this->input->post('employeenumber'));
             // Employees hired after May 31, 2013 have no sick leave credits.
             // They only earn vacation leave credits which can be used in place
             // of the sick leave.
             if (strtotime($this->employees->DateHired) > strtotime('May 31, 2013') && $this->input->post('leavetype') == 'Sick Leave') {
                 $leavetype = 'Vacation Leave';
             } else {
                 $leavetype = $this->input->post('leavetype');
             }
             $this->leave->updatecredits($this->input->post('employeenumber'), $leavetype, $this->input->post('leavefrom'), $this->input->post('leaveto'));
             // Update employee logs.
             $this->leave->leavedetails($this->input->post('leaveid'));
         }
     }
 }
开发者ID:hfugen112678,项目名称:webforms,代码行数:41,代码来源:Leaveapproval-WORKING-20151001.php

示例7: leavebydate

 /**
  * Get leaves by date. Will return json which will be consumed by the
  * fullcalendar.js plugin.
  *      
  */
 public function leavebydate()
 {
     $this->load->model(array('employeeleavesfiled'));
     $this->load->helper(array('my_datetime_helper'));
     $start = $this->input->get('start');
     $end = $this->input->get('end');
     $leaves = $this->employeeleavesfiled->get_leavesfiled_bydate($this->session->userdata('employeenumber'), $start, $end);
     $result = array();
     for ($i = 0; $i < count($leaves); $i++) {
         if ($leaves[$i]->Deleted == 1 && $leaves[$i]->WithPay == 0) {
             // Pending or not approved leave.
             $color = '#d6487e';
         } else {
             $color = '#82af6f';
         }
         // Notice the end date has a default time of 09:00:00, this is due
         // to the nextDayTreshold in fullcalendar.js
         // Refer to this link for the full explaination:
         // http://fullcalendar.io/docs/event_rendering/nextDayThreshold/
         $result[] = array('title' => $leaves[$i]->Reason, 'start' => convert_date($leaves[$i]->LeaveFrom, 'Y-m-d'), 'end' => convert_date($leaves[$i]->LeaveTo, 'Y-m-d 09:00:00'), 'leavetype' => trim($leaves[$i]->Type), 'color' => $color, 'leaveid' => $leaves[$i]->LeaveID);
     }
     echo json_encode($result);
 }
开发者ID:hfugen112678,项目名称:webforms,代码行数:28,代码来源:Leaves.php

示例8: checknextfewdays

function checknextfewdays($fecha, $feast, $num, $type, $month)
{
    if ($fecha) {
        $celebration = convert_date($fecha, $feast);
        if ($type == 'month') {
            $mes = explode("/", $celebration);
            if ($mes[1] == $month) {
                return true;
            } else {
                return false;
            }
        } elseif ($type == 'next') {
            $until = check_days($celebration);
            if ($until >= 0 && $until <= $num) {
                $until++;
                return $until;
            } else {
                return false;
            }
        }
    } else {
        return false;
    }
}
开发者ID:iionly,项目名称:celebrations,代码行数:24,代码来源:celebrations_lib.php

示例9: while

 echo "<table cellpadding=\"2\">\n";
 $isData = false;
 while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
     if (!$isData) {
         require_once 'includes/convert_date.php';
         echo "<tr><td valign=\"bottom\"><form action=\"gmembers.php\" method=\"post\"><input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\"><input type=\"hidden\" name=\"orderby\" value=\"name\"><input type=\"submit\" class=\"{$btnUsername}\" value=\"" . T_("Username") . "\"></form></td><td valign=\"bottom\"><form action=\"gmembers.php\" method=\"post\"><input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\"><input type=\"hidden\" name=\"orderby\" value=\"formatted_time\"><input type=\"submit\" class=\"{$btnDateJoin}\" value=\"" . T_("Date Joined") . "\"></form></td><td valign=\"bottom\"><form action=\"gmembers.php\" method=\"post\"><input type=\"hidden\" name=\"group_id\" value=\"{$group_id}\"><input type=\"hidden\" name=\"orderby\" value=\"priv\"><input type=\"submit\" class=\"{$btnPriv}\" value=\"" . T_("Privilege") . "\"></form></td>";
         if ($partOf) {
             //If the manager
             echo "<td>" . T_("Delete") . "</td><td align=\"center\"><b style=\"text-decoration:underline; cursor:pointer;\" onmouseover=\"return overlib('" . T_("Select the checkbox to remove all his bookmarks") . "');\" onmouseout=\"return nd();\">?</b></td>";
         }
         echo "</tr>\n";
         $isData = true;
     }
     $rec_name = "{$row["name"]}";
     $rec_date_join = "{$row["formatted_time"]}";
     $newDate = convert_date($rec_date_join);
     $rec_priv = "{$row["priv"]}";
     $priv = returnPrivName($rec_priv);
     // TODO: Review privileges, not using a db cause of translations
     $privn0 = returnPrivName('0');
     $privn1 = returnPrivName('1');
     $privn2 = returnPrivName('2');
     $priv0 = "0";
     $priv1 = "1";
     $priv2 = "2";
     switch ($rec_priv) {
         case 0:
             $priv0 .= "\" selected=\"selected";
             break;
         case 1:
             $priv1 .= "\" selected=\"selected";
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:gmembers.php

示例10: pageNav

 }
 if ($topic_title == '') {
     $topic_title = $l_emptyTopic;
 }
 if ($i > 0) {
     $bg = 'tbCel1';
 } else {
     $bg = 'tbCel2';
 }
 if (isset($mod_rewrite) and $mod_rewrite) {
     $urlp = "{$main_url}/{$forum}_{$topic}_";
 } else {
     $urlp = "{$main_url}/{$indexphp}action=vthread&amp;forum={$forum}&amp;topic={$topic}&amp;page=";
 }
 $pageNavCell = pageNav(0, $numReplies + 1, $urlp, $forum == $CONF['forum_submittedarticles'] || $forum == $CONF['forum_gallery'] ? 10 : $viewmaxreplys, TRUE);
 $whenPosted = convert_date($cols[4]);
 if (trim($cols[1]) == '') {
     $cols[1] = $l_emptyTopic;
 }
 //Forum icon
 if (isset($fIcon[$forum])) {
     $forumIcon = $fIcon[$forum];
 } else {
     $forumIcon = 'default.gif';
 }
 if (isset($mod_rewrite) and $mod_rewrite) {
     $linkToTopic = "{$main_url}/{$forum}_{$topic}_0.html";
 } else {
     $linkToTopic = "{$main_url}/{$indexphp}action=vthread&amp;forum={$forum}&amp;topic={$topic}";
 }
 $list_topics .= ParseTpl($tpl);
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:bb_func_ldisc.php

示例11: tzs_front_end_my_shipments_handler


//.........这里部分代码省略.........
                    ?>
" <?php 
                    echo $row->order_status == 1 ? ' class="top_record"' : ($row->order_status !== null && $row->order_status == 0 ? ' class="pre_top_record"' : '');
                    ?>
 >
                                <td>
                                    <?php 
                    echo $row->id;
                    ?>
<br>
                                    <?php 
                    echo convert_time($row->time);
                    ?>
                                </td>
                                <td>
                                        <?php 
                    echo tzs_city_to_str($row->from_cid, $row->from_rid, $row->from_sid, $row->sh_city_from);
                    ?>
<br/><?php 
                    echo tzs_city_to_str($row->to_cid, $row->to_rid, $row->to_sid, $row->sh_city_to);
                    ?>
                                        <?php 
                    if ($row->distance > 0) {
                        ?>
                                                <br/>
                                                <?php 
                        echo tzs_make_distance_link($row->distance, false, array($row->sh_city_from, $row->sh_city_to));
                        ?>
                                        <?php 
                    }
                    ?>
                                </td>
                                <td><?php 
                    echo convert_date($row->sh_date_from);
                    ?>
<br/><?php 
                    echo convert_date($row->sh_date_to);
                    ?>
</td>

                                <td><?php 
                    echo $GLOBALS['tzs_sh_types'][$row->sh_type];
                    ?>
</td>
                                
                                <td>
                                <?php 
                    if ($row->sh_weight > 0) {
                        echo remove_decimal_part($row->sh_weight) . ' т<br>';
                    }
                    if ($row->sh_volume > 0) {
                        echo remove_decimal_part($row->sh_volume) . ' м³';
                    }
                    ?>
                                </td>

                                <td><?php 
                    echo htmlspecialchars($row->sh_descr);
                    ?>
</td>
                                <td>
                                    <?php 
                    if ($row->price > 0) {
                        echo $row->price . ' ' . $GLOBALS['tzs_curr'][$row->price_val] . '<br><br>';
                        echo round($row->price / $row->distance, 2) . ' ' . $GLOBALS['tzs_curr'][$row->price_val] . '/км';
                    }
开发者ID:serker72,项目名称:T3S,代码行数:67,代码来源:tzs.my.shipments_old.php

示例12: checkAccess

$sorting_script = true;
include 'header.php';
include 'access.php';
$access = checkAccess('a');
if ($access) {
    echo "<h2>" . T_("Settings") . " -- " . T_("Online Users") . "</h2>";
    echo "<p>" . sprintf(T_("You can see a list of users who have been active in the past %s minutes"), ONLINE_TIMEOUT / 60) . ".</p>\n";
    include 'conn.php';
    $Query = "select name, LastActivity as formatted_time from " . TABLE_PREFIX . "session where " . DATE_DIFF_SQL . " LastActivity) < " . ONLINE_TIMEOUT . " and status <> 'disabled' order by LastActivity";
    $dbResult = $dblink->query($Query);
    //echo($Query . "<br>");
    $count = 0;
    while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
        if ($count == 0) {
            echo "<div class=\"content\"><table class='sortable'>\n<thead><tr><th>" . T_("User") . "</th><th>" . T_("Last Activity") . "</th></tr></thead><tbody>\n";
            require_once 'includes/convert_date.php';
        }
        $user_rec = "{$row["name"]}";
        $date1 = "{$row["formatted_time"]}";
        $date2 = convert_date($date1);
        echo "<tr><td><a href=\"userb.php?uname=" . $user_rec . "\">" . $user_rec . "</a></td><td>" . $date2 . "</td></tr>\n";
        $count++;
    }
    if ($count == 0) {
        echo "<p>" . sprintf(T_("No users have been active in the past %s minutes"), ONLINE_TIMEOUT / 60) . ".</p>\n";
    } else {
        echo "</tbody></table></div>\n";
    }
    echo "<p><a href=\"controlpanel.php\"><< " . T_("Back to Settings") . "</a></p>";
}
include 'footer.php';
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:onlineusers.php

示例13: convert_date

     $page['match'][$i]['team_visitor'] = $ligne['team_visitor_name'];
 }
 if ($ligne['team_home_name'] != NULL) {
     $page['match'][$i]['team_home'] = $ligne['team_home_name'];
 }
 $page['match'][$i]['sex_visitor'] = $ligne['sex_visitor_name'];
 $page['match'][$i]['sex_home'] = $ligne['sex_home_name'];
 $page['match'][$i]['sex_visitor_abbreviation'] = $ligne['sex_visitor_abbreviation'];
 $page['match'][$i]['sex_home_abbreviation'] = $ligne['sex_home_abbreviation'];
 $page['match'][$i]['competition'] = $ligne['competition_id'];
 $page['match'][$i]['competition_name'] = $ligne['competition_name'];
 $page['match'][$i]['field_state'] = $ligne['field_state_id'];
 $page['match'][$i]['field'] = $ligne['field_id'];
 $page['match'][$i]['weather'] = $ligne['weather_id'];
 $page['match'][$i]['date'] = convert_date($ligne['match_date'], $lang['match']['format_date_php']);
 $page['match'][$i]['hour'] = convert_date($ligne['match_date'], $lang['match']['format_hour_php']);
 if ($page['match'][$i]['hour'] == "00:00") {
     $page['match'][$i]['hour'] = "";
 }
 $page['match'][$i]['score_visitor'] = $ligne['match_score_visitor'];
 $page['match'][$i]['score_home'] = $ligne['match_score_home'];
 $page['match'][$i]['spectators'] = $ligne['match_spectators'];
 $page['match'][$i]['comment'] = $ligne['match_comment'];
 if ($tmp_date != $page['match'][$i]['date']) {
     $page['match'][$i]['show_date'] = '1';
 } else {
     $page['match'][$i]['show_date'] = '';
 }
 $tmp_date = $page['match'][$i]['date'];
 $page['match'][$i]['L_details'] = $lang['match']['show_view'];
 $page['match'][$i]['L_edit'] = $lang['match']['edit'];
开发者ID:jkreska,项目名称:test1,代码行数:31,代码来源:match_list.php

示例14: convert_date

 public static function convert_date($original_date, $new_format = '')
 {
     $original_date = convert_date($original_date, 'Y-m-d H:i:s');
     $original_date = str_replace('-', '/', $original_date);
     return date_i18n($new_format, strtotime($original_date));
 }
开发者ID:kosir,项目名称:thatcamp-org,代码行数:6,代码来源:abstract_model.php

示例15: test

function test($s)
{
    echo "<br>{$s} --> " . convert_date($s);
}
开发者ID:raynaldmo,项目名称:php-education,代码行数:4,代码来源:convert-date.php


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