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


PHP isDate函数代码示例

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


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

示例1: getTypeName

function getTypeName($val, $argument = null)
{
    $type = gettype($val);
    global $detectDateMode;
    switch ($type) {
        case "string":
            if ($detectDateMode == 1 && isDate($val)) {
                return "Date";
            } else {
                if ($detectDateMode == 2 && (bool) strtotime($val)) {
                    return "Date";
                } else {
                    return "String";
                }
            }
        case "integer":
            return "int";
        case "double":
            return "float";
        case "boolean":
            return "boolean";
        case "array":
            if (is_numeric(key($val))) {
                return "RealmList<" . $argument . ">";
            } else {
                return $argument;
            }
    }
    return null;
}
开发者ID:tomasz-m,项目名称:realmGenerator,代码行数:30,代码来源:processor.php

示例2: get_list

 /**
  * Get array of articles
  * 
  * For each article, set the article date.
  * The article date can be the creation date or the publish_on date if exists
  *
  * @access	public
  * @param 	array	An associative array
  * @return	array	Array of records
  *
  */
 function get_list($where = FALSE)
 {
     $data = array();
     $this->db->select($this->lang_table . '.*');
     $this->db->join($this->lang_table, $this->lang_table . '.id_' . $this->table . ' = ' . $this->table . '.id_' . $this->table, 'inner');
     $this->db->where($this->lang_table . '.lang', Settings::get_lang('default'));
     $data = parent::get_list($where);
     // Set the correct publish date
     foreach ($data as $key => $row) {
         $data[$key]['date'] = isDate($row['publish_on']) ? $row['publish_on'] : $row['created'];
     }
     return $data;
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:24,代码来源:article_model.php

示例3: valid_datetime_object

 function valid_datetime_object($t)
 {
     //only date
     if (type($t) == '_Date') {
         $y = $t->get_date();
     } elseif (type($t) == 'DateTime') {
         $y = $t;
     }
     if (isStr($t) && isDate($t)) {
         $s = explode('-', $t);
         $y = new DateTime();
         $y->setDate($s[0], $s[1], $s[2]);
     }
     if (isset($y)) {
         return $y;
     } else {
         return false;
     }
 }
开发者ID:hoangsoft90,项目名称:hw-sudoku-wordpress,代码行数:19,代码来源:hphp._Date.php

示例4: Exception

 require_once NOALYSS_INCLUDE . '/class_follow_up.php';
 /**
  * save info from the get
  */
 $date_event = HtmlInput::default_value_get("date_event", -1);
 $dest = HtmlInput::default_value_get("dest", "");
 $event_group = HtmlInput::default_value_get("event_group", 0);
 $event_priority = HtmlInput::default_value_get("event_priority", 0);
 $title = HtmlInput::default_value_get("title_event", NULL);
 $summary = HtmlInput::default_value_get("summary", "");
 $type_event = HtmlInput::default_value_get('type_event', -1);
 /*
  * Check if data are valid
  */
 try {
     if ($date_event == -1 || isDate($date_event) == 0) {
         throw new Exception(_('Date invalide'));
     }
     if (trim($dest) == "") {
         $dest_id = NULL;
     } else {
         $fiche = new Fiche($cn);
         $fiche->get_by_qcode($dest);
         $dest_id = $fiche->id;
         if ($dest_id == 0) {
             throw new Exception(_('Destinataire invalide'));
         }
     }
     if ($type_event == -1) {
         throw new Exception(_('Type invalide'));
     }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:31,代码来源:ajax_gestion.php

示例5: substr_replace

 }
 $strKey = substr_replace($strKey, "", -1);
 $strVal = substr_replace($strVal, "", -2);
 $query = "insert into debitur\r\n                            ({$strKey},usercreate,userupdate,action,tgl_update) \r\n                    values({$strVal},'{$userCreate}','{$userCreate}','{$datenow}','{$datenow}');";
 $buf = cleanstr($db_function->exec($query));
 if ($buf == "") {
     //--insert trail
     $strKey = "";
     $strVal = "'";
     $frmTrail = $_POST['frm'];
     $nonTrail = array('usercreate', 'action');
     foreach ($nonTrail as $row) {
         unset($frmTrail[$row]);
     }
     foreach ($frmTrail as $key => $val) {
         if (isDate($val)) {
             $val = balikTgl($val);
         }
         $strKey .= $key . ",";
         $strVal .= trim($val) . "','";
     }
     $strKey = substr_replace($strKey, "", -1);
     $strVal = substr_replace($strVal, "", -2);
     $query = "insert into debitur_trail\r\n                                (no_trail,{$strKey},userupdate,tgl_update) \r\n                        values('1',{$strVal},'{$userCreate}',now());";
     $buf = cleanstr($db_function->exec($query));
     if ($buf != "") {
         cleanstr($db_function->exec("delete from debitur where noaplikasi='" . $_POST['frm']['noaplikasi'] . "'"));
     }
 }
 //------------
 if ($buf != "") {
开发者ID:prabhaswara,项目名称:collateral,代码行数:31,代码来源:control_frminput.php

示例6: verify

 public function verify()
 {
     if (isDate($this->tl_date) == false) {
         $this->tl_date = date('d.m.Y');
     }
     return 0;
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:7,代码来源:class_todo_list.php

示例7: check

 function check()
 {
     /*
      * check date
      */
     if ($this->from != '' && isDate($this->from) == 0 || $this->to != '' && isDate($this->to) == 0) {
         return -1;
     }
     return 0;
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:10,代码来源:class_anc_print.php

示例8: cmpDate

/**
 * \brief  Compare 2 dates
 * \param p_date
 * \param p_date_oth
 *
 * \return
 *      - == 0 les dates sont identiques
 *      - > 0 date1 > date2
 *      - < 0 date1 < date2
 */
function cmpDate($p_date, $p_date_oth)
{
    date_default_timezone_set('Europe/Brussels');
    $l_date = isDate($p_date);
    $l2_date = isDate($p_date_oth);
    if ($l_date == null || $l2_date == null) {
        throw new Exception("erreur date [{$p_date}] [{$p_date_oth}]");
    }
    $l_adate = explode(".", $l_date);
    $l2_adate = explode(".", $l2_date);
    $l_mkdate = mktime(0, 0, 0, $l_adate[1], $l_adate[0], $l_adate[2]);
    $l2_mkdate = mktime(0, 0, 0, $l2_adate[1], $l2_adate[0], $l2_adate[2]);
    // si $p_date > $p_date_oth return > 0
    return $l_mkdate - $l2_mkdate;
}
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:25,代码来源:ac_common.php

示例9: whiteWebStat

function whiteWebStat($content)
{
    $splStr = '';
    $splxx = '';
    $filePath = '';
    $nCount = '';
    $url = '';
    $s = '';
    $visitUrl = '';
    $viewUrl = '';
    $viewdatetime = '';
    $ip = '';
    $browser = '';
    $operatingsystem = '';
    $cookie = '';
    $screenwh = '';
    $moreInfo = '';
    $ipList = '';
    $dateClass = '';
    $splxx = aspSplit($content, vbCrlf() . '-------------------------------------------------' . vbCrlf());
    $nCount = 0;
    foreach ($splxx as $key => $s) {
        if (inStr($s, '当前:') > 0) {
            $nCount = $nCount + 1;
            $s = vbCrlf() . $s . vbCrlf();
            $dateClass = ADSql(getFileAttr($filePath, '3'));
            $visitUrl = ADSql(getStrCut($s, vbCrlf() . '来访', vbCrlf(), 0));
            $viewUrl = ADSql(getStrCut($s, vbCrlf() . '当前:', vbCrlf(), 0));
            $viewdatetime = ADSql(getStrCut($s, vbCrlf() . '时间:', vbCrlf(), 0));
            $ip = ADSql(getStrCut($s, vbCrlf() . 'IP:', vbCrlf(), 0));
            $browser = ADSql(getStrCut($s, vbCrlf() . 'browser: ', vbCrlf(), 0));
            $operatingsystem = ADSql(getStrCut($s, vbCrlf() . 'operatingsystem=', vbCrlf(), 0));
            $cookie = ADSql(getStrCut($s, vbCrlf() . 'Cookies=', vbCrlf(), 0));
            $screenwh = ADSql(getStrCut($s, vbCrlf() . 'Screen=', vbCrlf(), 0));
            $moreInfo = ADSql(getStrCut($s, vbCrlf() . '用户信息=', vbCrlf(), 0));
            $browser = ADSql(getBrType($moreInfo));
            if (inStr(vbCrlf() . $ipList . vbCrlf(), vbCrlf() . $ip . vbCrlf()) == false) {
                $ipList = $ipList . $ip . vbCrlf();
            }
            $viewdatetime = replace($viewdatetime, '来访', '00');
            if (isDate($viewdatetime) == false) {
                $viewdatetime = '1988/07/12 10:10:10';
            }
            $screenwh = left($screenwh, 20);
            if (1 == 2) {
                aspEcho('编号', $nCount);
                aspEcho('dateClass', $dateClass);
                aspEcho('visitUrl', $visitUrl);
                aspEcho('viewUrl', $viewUrl);
                aspEcho('viewdatetime', $viewdatetime);
                aspEcho('IP', $ip);
                aspEcho('browser', $browser);
                aspEcho('operatingsystem', $operatingsystem);
                aspEcho('cookie', $cookie);
                aspEcho('screenwh', $screenwh);
                aspEcho('moreInfo', $moreInfo);
                HR();
            }
            connexecute('insert into ' . $GLOBALS['db_PREFIX'] . 'websitestat (visiturl,viewurl,browser,operatingsystem,screenwh,moreinfo,viewdatetime,ip,dateclass) values(\'' . $visitUrl . '\',\'' . $viewUrl . '\',\'' . $browser . '\',\'' . $operatingsystem . '\',\'' . $screenwh . '\',\'' . $moreInfo . '\',\'' . $viewdatetime . '\',\'' . $ip . '\',\'' . $dateClass . '\')');
        }
    }
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:62,代码来源:admin_function.php

示例10: insert

 function insert($p_date_start, $p_date_end, $p_exercice)
 {
     try {
         if (isDate($p_date_start) == null || isDate($p_date_end) == null || strlen(trim($p_exercice)) == 0 || (string) $p_exercice != (string) (int) $p_exercice || $p_exercice < COMPTA_MIN_YEAR || $p_exercice > COMPTA_MAX_YEAR) {
             throw new Exception("Paramètre invalide");
         }
         $p_id = $this->cn->get_next_seq('s_periode');
         $sql = sprintf(" insert into parm_periode(p_id,p_start,p_end,p_closed,p_exercice)" . "values (%d,to_date('%s','DD.MM.YYYY'),to_date('%s','DD.MM.YYYY')" . ",'f','%s')", $p_id, $p_date_start, $p_date_end, $p_exercice);
         $this->cn->start();
         $Res = $this->cn->exec_sql($sql);
         $Res = $this->cn->exec_sql("insert into jrn_periode (jrn_def_id,p_id,status) " . "select jrn_def_id,{$p_id},'OP' from jrn_def");
         $this->cn->commit();
     } catch (Exception $e) {
         $this->cn->rollback();
         return 1;
     }
     return 0;
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:18,代码来源:class_periode.php

示例11: format_Time

function format_Time($timeStr, $nType)
{
    $y = '';
    $m = '';
    $d = '';
    $h = '';
    $mi = '';
    $s = '';
    $format_Time = '';
    if (isDate($timeStr) == false) {
        return @$format_Time;
    }
    $y = cStr(year($timeStr));
    $m = cStr(month($timeStr));
    if (len($m) == 1) {
        $m = '0' . $m;
    }
    $d = cStr(day($timeStr));
    //在vb.net里要这样用  D = CStr(CDate(timeStr).Day)
    if (len($d) == 1) {
        $d = '0' . $d;
    }
    $h = cStr(hour($timeStr));
    if (len($h) == 1) {
        $h = '0' . $h;
    }
    $mi = cStr(minute($timeStr));
    if (len($mi) == 1) {
        $mi = '0' . $mi;
    }
    $s = cStr(second($timeStr));
    if (len($s) == 1) {
        $s = '0' . $s;
    }
    switch ($nType) {
        case 1:
            //yyyy-mm-dd hh:mm:ss
            $format_Time = $y . '-' . $m . '-' . $d . ' ' . $h . ':' . $mi . ':' . $s;
            break;
        case 2:
            //yyyy-mm-dd
            $format_Time = $y . '-' . $m . '-' . $d;
            break;
        case 3:
            //hh:mm:ss
            $format_Time = $h . ':' . $mi . ':' . $s;
            break;
        case 4:
            //yyyy年mm月dd日
            $format_Time = $y . '年' . $m . '月' . $d . '日';
            break;
        case 5:
            //yyyymmdd
            $format_Time = $y . $m . $d;
            break;
        case 6:
            //yyyymmddhhmmss
            $format_Time = $y . $m . $d . $h . $mi . $s;
            break;
        case 7:
            //mm-dd
            $format_Time = $m . '-' . $d;
            break;
        case 8:
            //yyyy年mm月dd日
            $format_Time = $y . '年' . $m . '月' . $d . '日' . ' ' . $h . ':' . $mi . ':' . $s;
            break;
        case 9:
            //yyyy年mm月dd日H时mi分S秒 早上
            $format_Time = $y . '年' . $m . '月' . $d . '日' . ' ' . $h . '时' . $mi . '分' . $s . '秒,' . getDayStatus($h, 1);
            break;
        case 10:
            //yyyy年mm月dd日H时
            $format_Time = $y . '年' . $m . '月' . $d . '日' . $h . '时';
            break;
        case 11:
            //yyyy年mm月dd日H时mi分S秒
            $format_Time = $y . '年' . $m . '月' . $d . '日' . ' ' . $h . '时' . $mi . '分' . $s . '秒';
            break;
        case 12:
            //yyyy年mm月dd日H时mi分
            $format_Time = $y . '年' . $m . '月' . $d . '日' . ' ' . $h . '时' . $mi . '分';
            break;
        case 13:
            //yyyy年mm月dd日H时mi分 早上
            $format_Time = $m . '月' . $d . '日' . ' ' . $h . ':' . $mi . ' ' . getDayStatus($h, 0);
            break;
        case 14:
            //yyyy年mm月dd日
            $format_Time = $y . '/' . $m . '/' . $d;
            break;
        case 15:
            //yyyy年mm月 第1周
            $format_Time = $y . '年' . $m . '月 第' . GetCountPage($d, 7) . '周';
    }
    return @$format_Time;
}
开发者ID:313801120,项目名称:AspPhpCms,代码行数:97,代码来源:Time.php

示例12: date

 public static function date(FTL_Binding $tag)
 {
     if (!isDate($tag->locals->comment["created"])) {
         return;
     }
     return $tag->locals->comment["created"];
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:7,代码来源:tags.php

示例13: ob_start

    case 'save':
        ob_start();
        try {
            $cn->start();
            if ($access == "W") {
                if (isset($_POST['p_ech'])) {
                    $ech = $_POST['p_ech'];
                    if (trim($ech) != '' && isDate($ech) != null) {
                        $cn->exec_sql("update jrn set jr_ech=to_date(\$1,'DD.MM.YYYY') where jr_id=\$2", array($ech, $jr_id));
                    } else {
                        $cn->exec_sql("update jrn set jr_ech=null where jr_id=\$1", array($jr_id));
                    }
                }
                if (isset($_POST['p_date_paid'])) {
                    $ech = $_POST['p_date_paid'];
                    if (trim($ech) != '' && isDate($ech) != null) {
                        $cn->exec_sql("update jrn set jr_date_paid=to_date(\$1,'DD.MM.YYYY') where jr_id=\$2", array($ech, $jr_id));
                    } else {
                        $cn->exec_sql("update jrn set jr_date_paid=null where jr_id=\$1", array($jr_id));
                    }
                }
                $cn->exec_sql("update jrn set jr_comment=\$1,jr_pj_number=\$2,jr_date=to_date(\$4,'DD.MM.YYYY') where jr_id=\$3", array($_POST['lib'], $_POST['npj'], $jr_id, $_POST['p_date']));
                $cn->exec_sql("update jrnx set j_date=to_date(\$1,'DD.MM.YYYY') where j_grpt in (select jr_grpt_id from jrn where jr_id=\$2)", array($_POST['p_date'], $jr_id));
                $cn->exec_sql('update operation_analytique set oa_date=j_date from jrnx
				where
				operation_analytique.j_id=jrnx.j_id  and
				operation_analytique.j_id in (select j_id
						from jrnx join jrn on (j_grpt=jr_grpt_id)
						where jr_id=$1)
						', array($jr_id));
                $cn->exec_sql("select comptaproc.jrn_add_note(\$1,\$2)", array($jr_id, $_POST['jrn_note']));
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:31,代码来源:ajax_ledger.php

示例14: verify

 /**
  * Verify that data are correct
  * @throws Exception
  */
 function verify()
 {
     if ($this->dt_id == -1) {
         throw new Exception(_('Type action invalide'), 10);
     }
     if (isDate($this->ag_timestamp) != $this->ag_timestamp) {
         throw new Exception(_('Date invalide'), 20);
     }
     if (isDate($this->ag_remind_date) != $this->ag_remind_date) {
         throw new Exception(_('Date invalide'), 30);
     }
     if ($this->f_id_dest == 0) {
         $this->f_id_dest = null;
     }
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:19,代码来源:class_follow_up.php

示例15: tr

echo tr($r);
// limit of the year
$exercice = $g_user->get_exercice();
$periode = new Periode($cn);
list($first_per, $last_per) = $periode->get_limit($exercice);
$start = new IDate('start');
if (isset($_GET['start']) && isDate($_GET['start']) == null) {
    echo alert(_('Date malformée, désolé'));
    $_GET['start'] = $first_per->first_day();
}
$start->value = isset($_GET['start']) ? $_GET['start'] : $first_per->first_day();
$r = td(_('Date début'));
$r .= td($start->input());
echo tr($r);
$end = new IDate('end');
if (isset($_GET['end']) && isDate($_GET['end']) == null) {
    echo alert(_('Date malformée, désolé'));
    $_GET['end'] = $last_per->last_day();
}
$end->value = isset($_GET['end']) ? $_GET['end'] : $last_per->last_day();
$r = td(_('Date fin'));
$r .= td($end->input());
echo tr($r);
// type of lettering : all, lettered, not lettered
$sel = new ISelect('type_let');
$sel->value = array(array('value' => 0, 'label' => _('Toutes opérations')), array('value' => 1, 'label' => _('Opérations lettrées')), array('value' => 3, 'label' => _('Opérations lettrées montants différents')), array('value' => 2, 'label' => _('Opérations NON lettrées')));
if (isset($_GET['type_let'])) {
    $sel->selected = $_GET['type_let'];
}
$r = td("Filtre ") . td($sel->input());
echo tr($r);
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:31,代码来源:lettering.card.inc.php


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