本文整理汇总了PHP中ConvertDate函数的典型用法代码示例。如果您正苦于以下问题:PHP ConvertDate函数的具体用法?PHP ConvertDate怎么用?PHP ConvertDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ConvertDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor for vacancy
*
* @param array $vacancy_row
*/
public function __construct(array $vacancy_row)
{
$this->vacancy = array_intersect_key($vacancy_row, array_flip(self::$DB_fields));
if (!empty($this->vacancy['company_id'])) {
$this->vacancy['company'] = new Company($vacancy_row);
} else {
$this->vacancy['company'] = null;
}
if (!empty(self::$job->tpl)) {
$this->vacancy['vacancy_url'] = self::$job->tpl->GetUrl(array('action' => 'vacancy', 'id' => $this->vacancy['id']));
}
$this->vacancy['rss_add_date'] = date("r", $this->vacancy['add_date']);
$this->vacancy['description'] = nl2br($this->vacancy['description']);
if (!empty($this->vacancy['add_date'])) {
$this->vacancy['add_date'] = ConvertDate($this->vacancy['add_date'], self::$job);
}
if (!empty($this->vacancy['date_exp'])) {
$this->vacancy['date_exp'] = $this->vacancy['exp_date'] = ConvertDate($this->vacancy['date_exp'], self::$job);
} else {
$this->vacancy['date_exp'] = self::$job->lang['no_limit'];
}
if ($this->vacancy['salary_min'] && $this->vacancy['salary_max'] && $this->vacancy['salary_min'] != $this->vacancy['salary_max']) {
$this->vacancy['salary'] = $this->vacancy['salary_min'] . " - " . $this->vacancy['salary_max'] . " " . self::$job->lang[$this->vacancy['currency']];
} elseif ($this->vacancy['salary_min'] == $this->vacancy['salary_max'] && $this->vacancy['salary_min']) {
$this->vacancy['salary'] = $this->vacancy['salary_min'] . " " . self::$job->lang[$this->vacancy['currency']];
} elseif ($this->vacancy['salary_min']) {
$this->vacancy['salary'] = self::$job->lang['from'] . $this->vacancy['salary_min'] . " " . self::$job->lang[$this->vacancy['currency']];
} elseif ($this->vacancy['salary_max']) {
$this->vacancy['salary'] = self::$job->lang['to'] . $this->vacancy['salary_max'] . " " . self::$job->lang[$this->vacancy['currency']];
} else {
$this->vacancy['salary'] = self::$job->lang['contract_salary'];
}
if ($this->vacancy['age_min'] && $this->vacancy['age_max'] && $this->vacancy['age_min'] != $this->vacancy['age_max']) {
$this->vacancy['age'] = $this->vacancy['age_min'] . " - " . $this->vacancy['age_max'];
} elseif ($this->vacancy['age_min'] == $this->vacancy['age_max']) {
$this->vacancy['age'] = $this->vacancy['age_min'];
} elseif ($this->vacancy['age_min']) {
$this->vacancy['age'] = self::$job->lang['from'] . $this->vacancy['age_min'];
} elseif ($this->vacancy['age_max']) {
$this->vacancy['age'] = self::$job->lang['to'] . $this->vacancy['age_max'];
} else {
$this->vacancy['age'] = self::$job->lang['no_show'];
}
foreach (self::$fields as $field_name => $values_array) {
if ($values_array[$this->vacancy[$field_name]]) {
$this->vacancy[$field_name] = $values_array[$this->vacancy[$field_name]];
}
}
}
示例2: __construct
/**
* Constructor for resume class
*
* @param array $resume_row
*/
public function __construct(array $resume_row)
{
$this->resume = array_intersect_key($resume_row, array_flip(self::$DB_fields));
if (!empty($this->resume['add_date'])) {
$this->resume['add_date'] = ConvertDate($this->resume['add_date'], self::$job);
}
if (!empty(self::$job->tpl)) {
$this->resume['resume_url'] = self::$job->tpl->GetUrl(array('action' => 'resume', 'id' => $this->resume['id']));
}
$this->resume['rss_add_date'] = date("r", $this->resume['add_date']);
$this->resume['description'] = nl2br($this->resume['description']);
if (!empty($this->resume['date_exp'])) {
$this->resume['date_exp'] = $this->resume['exp_date'] = ConvertDate($this->resume['date_exp'], self::$job);
} else {
$this->resume['date_exp'] = self::$job->lang['no_limit'];
}
if ($this->resume['salary_min'] && $this->resume['salary_max'] && $this->resume['salary_min'] != $this->resume['salary_max']) {
$this->resume['salary'] = $this->resume['salary_min'] . " - " . $this->resume['salary_max'] . " " . self::$job->lang[$this->resume['currency']];
} elseif ($this->resume['salary_min'] && $this->resume['salary_min'] == $this->resume['salary_max']) {
$this->resume['salary'] = $this->resume['salary_min'] . " " . self::$job->lang[$this->resume['currency']];
} elseif ($this->resume['salary_min']) {
$this->resume['salary'] = self::$job->lang['from'] . $this->resume['salary_min'] . " " . self::$job->lang[$this->resume['currency']];
} elseif ($this->resume['salary_max']) {
$this->resume['salary'] = self::$job->lang['to'] . $this->resume['salary_max'] . " " . self::$job->lang[$this->resume['currency']];
} else {
$this->resume['salary'] = 0;
}
foreach (self::$fields as $field_name => $values_array) {
if ($values_array[$this->resume[$field_name]]) {
$this->resume[$field_name] = $values_array[$this->resume[$field_name]];
}
}
if ($this->resume['photo']) {
$this->resume['photo_url'] = PHOTO_URL_PATCH . $this->resume['photo'];
} else {
$this->resume['photo_url'] = PHOTO_URL_PATCH . 'no_photo.jpg';
}
}
示例3: __construct
/**
* Costrusctor compan class
*
* Create new object of company with company information
*
* @param array $company Array from DataBase
*/
public function __construct(array $company = array())
{
$this->company = array_intersect_key($company, array_flip(self::$DB_fields));
if ($this->company['add_date']) {
$this->company['add_date'] = ConvertDate($this->company['add_date'], self::$job);
}
if (!empty($this->company['OPF'])) {
$this->company['OPF'] = self::$OPF_array[$this->company['OPF']];
}
if (!empty($this->company['company_type'])) {
if ($this->company['company_type'] == "PA") {
$this->company['company_type'] = self::$job->lang['PA'];
} else {
$this->company['company_type'] = self::$job->lang['EM'];
}
}
if ($this->company['logo']) {
$this->company['logo_url'] = LOGO_URL_PATCH . $this->company['logo'];
} else {
$this->company['logo_url'] = LOGO_URL_PATCH . "no_logo.jpg";
}
$this->company['site'] = "<a href=\"" . $this->company['site'] . "\" >" . $this->company['site'] . "</a>";
$this->company['description'] = nl2br($this->company['description']);
}
示例4: ConvertDate
echo $dateStartCap;
?>
</div>
<div class="floatL form_input"><input type="text" name="txtStartDate" id="txtStartDate" value="<?php
echo ConvertDate($row['EVENT_START_DATE']);
?>
" class="DatePicker" /></div>
<div class="clear"></div>
</div>
<div <?php
echo $hideEndDate;
?>
>
<div class="floatL form_name">วันที่สิ้นสุด</div>
<div class="floatL form_input"><input type="text" name="txtEndDate" id = "txtEndDate" value="<?php
echo ConvertDate($row['EVENT_END_DATE']);
?>
" class="DatePicker" /></div>
<div class="clear"></div>
</div>
<div <?php
echo $hideEndDate;
?>
>
<div class="floatL form_name">เวลาเริ่ม</div>
<div class="floatL form_input">
<select name="cmbHourStart">
<?php
示例5: ConvertDate
echo $MID;
?>
&CID=<?php
echo $row_Category['CONTENT_CAT_ID'];
?>
&CONID=<?php
echo $row_Category['CONTENT_ID'];
?>
&link=perm">
<p class="text-title"><?php
echo $row_Category['CONTENT_DESC'];
?>
</p>
</a>
<p class="text-date"><?php
echo ConvertDate($row_Category['LAST_DATE']);
?>
</p>
<p class="text-des"><?php
echo $row_Category['BRIEF_LOC'];
?>
</p>
<div class="box-btn cf">
<a href="ve-detail.php?MID=<?php
echo $MID;
?>
&CID=<?php
echo $row_Category['CONTENT_CAT_ID'];
?>
&CONID=<?php
echo $row_Category['CONTENT_ID'];
示例6: ConvertDate
<p class="text-detail">
<span><?=$typeCap?>: .<?=$ext ?></span>
<span><?=$sizeCap?>: <?=$size ?></span>
</p>
</div>
<div class="box-btn cf">
<a href="<?=$link ?>" target="_blank" class="btn red"><?=$downloadCap ?></a>
</div>
</div>
<?php } } ?>
</div>
</div>
<?php } ?>
<div class="box-footer-content cf">
<div class="box-date-modified">
<?=$lastEditCap ?> : <?= ConvertDate($lastDate) ?>
</div>
<div class="box-plugin-social">
<div class="fb-share-button" data-href="<?=$path ?>" data-layout="button_count"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<?=$fullpath ?>">Tweet</a>
<div class="g-plus" data-action="share" data-annotation="bubble" data-href="<?=$fullpath ?>"></div>
<span>
<script type="text/javascript" src="//media.line.me/js/line-button.js?v=20140411" ></script>
<script type="text/javascript">
new media_line_me.LineButton({"pc":false,"lang":"en","type":"a","text":"<?=$path ?>
","withUrl":true});
</script>
</span>
</div>
</div>
</div>
示例7: AND
LEFT JOIN sys_app_user u ON u.USER_ID = prod.CUSTOMER_ID
LEFT JOIN trn_product p ON p.PRODUCT_ID = pic.PRODUCT_ID
LEFT JOIN trn_order_status s ON s.STATUS_ID = prod.FLAG
WHERE prod.CUSTOMER_ID = '".$_SESSION['UID']."' AND (prod.TYPE = 'ticket' OR prod.TYPE = 'booking') ";
$sql .= "order by prod.ORDER_ID desc";
$query = mysql_query($sql,$conn);
while($row = mysql_fetch_array($query)) {
?>
<div class="table-row list cf">
<div class="column order">158686047</div>
<div class="column date"><? echo ConvertDate($row['CREATE_DATE']); ?></div>
<div class="column name"><? echo $row['PRODUCT_DESC_LOC']; ?></div>
<div class="column num"><? echo $row['QUANTITY']; ?></div>
<div class="column price"><? echo $row['PRICE']; ?></div>
<div class="column total"><? echo $row['SUMPRICE']; ?></div>
<div class="column status"><? echo $row['STATUS_NAME_LOC']; ?></div>
</div>
<? }
/*
?>
<div class="box-pagination-main cf">
<ul class="pagination">
<li class="deactive"><a href="" class="btn-arrow-left"></a></li>
<li class="active"><a href="">1</a></li>
示例8: ConvertDate
echo $row['MUSEUM_DESC'];
echo '</div>';
echo '<div class="box-date-tumb type2">';
echo '<p class="date">' . $date[0] . '-' . $dateEnd[0] . '</p>';
echo '<p class="month">' . $date[1] . '-' . $dateEnd[1] . '</p>';
echo '</div>';
echo '</div>';
echo '</a>';
echo '<div class="box-text">';
echo '<a href="event-detail.php?MID=' . $MID . '&CID=' . $categoryID . '&SID=' . $row['SUB_CAT_ID'] . '&CONID=' . $row['CONTENT_ID'] . '&date=event_week">';
echo '<p class="text-title TcolorRed">';
echo $title;
echo '</p>';
echo '</a>';
echo '<p class="text-date TcolorGray">';
echo ConvertDate($row['CREATE_DATE']);
echo '</p>';
echo '<p class="text-des TcolorBlack">';
echo $detail;
echo '</p>';
echo '<div class="box-btn cf">';
echo '<a href="event-detail.php?MID=' . $MID . '&CID=' . $categoryID . '&SID=' . $row['SUB_CAT_ID'] . '&CONID=' . $row['CONTENT_ID'] . '&date=event_week" class="btn red">อ่านเพิ่มเติม</a>';
echo '<div class="box-btn-social cf">';
echo '<a href="' . $fb_link . '" onclick="shareFB(\'' . $title . '\',$(this).attr(\'href\')); return false;" class="btn-socila fb"></a>';
echo '<a href="' . $fullpath . '" onclick="shareTW(\'' . $row_row1['CONTENT_ID'] . '\',\'' . $title . '\',$(this).attr(\'href\')); return false;" class="btn-socila tw"></a>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
$index++;
}
示例9: ConvertDate
$oldemail = $_POST['oldemail'];
$phone = $modx->db->escape($_POST['phone']);
$mobilephone = $modx->db->escape($_POST['mobilephone']);
$fax = $modx->db->escape($_POST['fax']);
$dob = !empty($_POST['dob']) ? ConvertDate($_POST['dob']) : 0;
$country = $_POST['country'];
$state = $modx->db->escape($_POST['state']);
$zip = $modx->db->escape($_POST['zip']);
$gender = !empty($_POST['gender']) ? $_POST['gender'] : 0;
$photo = $modx->db->escape($_POST['photo']);
$comment = $modx->db->escape($_POST['comment']);
$roleid = !empty($_POST['role']) ? $_POST['role'] : 0;
$failedlogincount = !empty($_POST['failedlogincount']) ? $_POST['failedlogincount'] : 0;
$blocked = !empty($_POST['blocked']) ? $_POST['blocked'] : 0;
$blockeduntil = !empty($_POST['blockeduntil']) ? ConvertDate($_POST['blockeduntil']) : 0;
$blockedafter = !empty($_POST['blockedafter']) ? ConvertDate($_POST['blockedafter']) : 0;
$user_groups = $_POST['user_groups'];
// verify password
if ($passwordgenmethod == "spec" && $_POST['specifiedpassword'] != $_POST['confirmpassword']) {
webAlert("Password typed is mismatched");
exit;
}
// verify email
if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}\$/i", $email)) {
webAlert("E-mail address doesn't seem to be valid!");
exit;
}
switch ($_POST['mode']) {
case '87':
// new user
// check if this user name already exist
示例10: ConvertDate
?>
">
<span class="box-pic Search_image_thumb"></span>
</a>
<div class="box-text">
<a href="<?php
echo $path;
?>
">
<p class="text-title TcolorRed"><?php
echo $title;
?>
</p>
</a>
<p class="text-date TcolorGray"><?php
echo ConvertDate($row_row1['CONTENT_DATE']);
?>
</p>
<p class="text-des TcolorBlack"><?php
echo $detail;
?>
</p>
<div class="box-btn cf">
<a href="<?php
echo $path;
?>
" class="btn red"><?php
echo $txt_more;
?>
</a>
<div class="box-btn-social cf">
示例11: mysql_fetch_assoc
}
$usernamedata = mysql_fetch_assoc($rs);
$_SESSION['itemname'] = $usernamedata['username'];
} else {
$userdata = array();
$usersettings = array();
$usernamedata = array();
$_SESSION['itemname'] = "New web user";
}
// restore saved form
$formRestored = false;
if ($modx->manager->hasFormValues()) {
$modx->manager->loadFormValues();
// restore post values
$userdata = array_merge($userdata, $_POST);
$userdata['dob'] = ConvertDate($userdata['dob']);
$usernamedata['username'] = $userdata['newusername'];
$usernamedata['oldusername'] = $_POST['oldusername'];
$usersettings = array_merge($usersettings, $userdata);
$usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
extract($usersettings, EXTR_OVERWRITE);
}
// converts date format dd-mm-yyyy to php date
function ConvertDate($date)
{
global $modx;
if ($date == "") {
return "0";
} else {
}
return $modx->toTimeStamp($date);
示例12: ConvertDate
<div class="label_right">
<div class="input-group date form-w250">
<input type="text" class="form-control" name="CompleteWorkDate" id="CompleteWorkDate" value="<?php
echo ConvertDate($dataDoc['CompleteWorkDate'], 'd/m/Y');
?>
">
<span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
</div>
</div>
<div class="info_left">
<div class="label_left">วดป. ที่ยกเลิกงาน :</div>
<div class="label_right">
<div class="input-group date form-w250">
<input type="text" class="form-control" name="CancelWorkDate" id="CancelWorkDate" value="<?php
echo ConvertDate($dataDoc['CancelWorkDate'], 'd/m/Y');
?>
">
<span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
</div>
</div>
</div>
<div class="clean"></div>
</div>
</div>
<!--*************************************Sheet 3 End ****************-->
<!--*************************************Sheet 4 ****************-->
<div role="tabpanel" id="machine" class="tab-pane fade" aria-labelledby="machine-tab">
<div class="incontent">
示例13: FileRead
//.........这里部分代码省略.........
$num_inserts++;
//echo "Processing#".$num_inserts."........ at time ".time()."<BR>".var_dump($data)."<BR>\n";
$SQLFieldValues="";
$SQLFieldNames="";
foreach ($idxMap as $spreadsheetFieldName => $spreadsheetFieldIdx)
{
$fieldValue=$data [ $spreadsheetFieldIdx ]; //spreadsheet value
$fieldName =$fieldMap[ $spreadsheetFieldName ]; //mysql table field name
//echo "---".$fieldName."-------------------".$fieldValue."<br />";
if (( strpos(strtolower($spreadsheetFieldName),'revenue')!==false ||
strpos(strtolower($spreadsheetFieldName),'amount')!==false ) &&
strpos(strtolower($spreadsheetFieldName),'date') ===false)
{
//echo "----".$fieldName."-------------------".$fieldValue."<br />";
//if ($spreadsheetFieldName=="Bookings Amount - CD")
//echo $spreadsheetFieldName.":::::::".$fieldValue.">>>>".CutRevenue($fieldValue);
$fieldValue=CutRevenue($fieldValue,$fieldMap['1000SCALE']); // remove number fractions
}
if ( strpos(strtolower($spreadsheetFieldName),'date') !==false || strpos($spreadsheetFieldName,'FORECAST_DT') !==false )
{
//echo "-----".$fieldName."-------------------".$fieldValue."<br />";
$fieldValue=ConvertDate($fieldValue,$spreadsheetFieldName,$num_inserts); // dates - format conversion
}
if ( trim($spreadsheetFieldName)=="Fiscal Quarter" )
{
//ES: "2012 FY Q 1"
$fieldValue=str_replace(" ","",$fieldValue);
$exp=explode("FY",$fieldValue);
$fieldValue=$exp[1]."FY".substr($exp[0],2);
//echo $fieldValue."<br />";
}
if (isset($fieldMap['AUTOFILL']) && $fieldMap['AUTOFILL']!=='false' && $fieldName!="ChildName") {
if ($fieldValue!='') {
$LastVal[$fieldName]=$fieldValue;
} else {
$fieldValue=$LastVal[$fieldName];
}
}
$SQLFieldNames .=", `".$fieldName."`" ;
$SQLFieldValues.=",'".addslashes(trim(str_replace("'","`",$fieldValue)))."'";
}
if (!isset($fieldMap['NOTAUTOID']))
{
$SQLFieldNames="id".$SQLFieldNames;
$SQLFieldValues="''".$SQLFieldValues;
示例14:
</div>
<div class="box-right">
<p>
<?=$DayOfWeek?>
<br>
<span><?=$shortMonth?> <?=ShowYear($row['EVENT_START_DATE'])?></span>
</p>
</div>
</div>
<div class="box-text">
<a href="">
<p class="text-title TcolorRed">
<?=$title?>
</p> </a>
<p class="text-date TcolorGray">
<?=ConvertDate($row['LAST_DATE'])?>
</p>
<p class="text-des TcolorBlack">
<?=$detail?>
</p>
<div class="box-btn cf">
<a href="event-detail.php?MID=<?=$MID?>&CID=<?=$row['CAT_ID']?>&SID=<?=$row['SUB_CAT_ID']?>&CONID=<?=$row['CONTENT_ID']?>" class="btn red"><?=$seeAllCap?></a>
<div class="box-btn-social cf">
<?php
echo ' <a href="'.$fb_link.'" onclick="shareFB(\''.$rowContent['CONTENT_DESC'].'\',$(this).attr(\'href\')); return false;" class="btn-socila fb"></a>';
echo ' <a href="'.$fullpath.'" onclick="shareTW(\''.$rowContent['CONTENT_ID'].'\',\''.$rowContent['CONTENT_DESC'].'\',$(this).attr(\'href\')); return false;" class="btn-socila tw"></a>';
?>
</div>
</div>
</div>
</div>
示例15: mysql_fetch_array
while($row = mysql_fetch_array($query)) {
?>
<div class="box-carrer-main">
<div class="box-row">
<div class="box-top cf">
<h3><? echo $row['CONTENT_DESC'] ?></h3>
<div class="number"><span><? echo $row['PRICE_RATE_LOC'] ?></span> อัตรา</div>
</div>
<div class="box-bottom cf">
<div class="box-footer-content cf">
<div class="box-date-modified">
<?=$lastEditCap?> : <? echo ConvertDate($row['CREATE_DATE']) ?>
</div>
</div>
</div>
</div>
</div>
<div class="box-detail-main">
<? echo $row['CONTENT_DETAIL_LOC'] ?>
<div class="box-btn cf">
<a href="contact-eapp-register.php" class="btn red">Apply job</a>
</div>
</div>