本文整理汇总了PHP中getDateTime函数的典型用法代码示例。如果您正苦于以下问题:PHP getDateTime函数的具体用法?PHP getDateTime怎么用?PHP getDateTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getDateTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log
/**
* log a subscription request to the database
* @param string $recipientEmail the email address of the recipient
* @param string $recipientName the name of the recipient
* @param array $fields set of fields (answers) to assign to the user record
* @param string $listId unique identifier for the list
* @param string $clientId unique identifier for the client making the request
* @return null
*/
public function log($recipientEmail, $recipientName, $fields, $listId, $clientId)
{
$logged = $this->repo->store(["list_id" => $listId, "client_id" => $clientId, "recipient_email" => $recipientEmail, "recipient_name" => $recipientName, "fields" => json_encode($fields), "requested" => getDateTime()]);
if (!$logged) {
return apiErrorResponse('badRequest', ['errors' => "There was a problem with the request."]);
}
Event::fire('RequestWasLogged');
return apiSuccessResponse('ok');
}
示例2: match
public function match($data1, $data2)
{
$Kundali = new Library_Kundali();
$fromDate = getDateTime($data1['dob']);
$toDate = getDateTime($data2['dob']);
$returnArrFrom = $Kundali->precalculate($fromDate['month'], $fromDate['day'], $fromDate['year'], $fromDate['hour'], $fromDate['minute'], $data1['zone_h'], $data1['zone_m'], $data1['lon_h'], $data1['lon_m'], $data1['lat_h'], $data1['lat_m'], $data1['dst'], $data1['lon_e'], $data1['lat_s']);
$returnArrTo = $Kundali->precalculate($toDate['month'], $toDate['day'], $toDate['year'], $toDate['hour'], $toDate['minute'], $data2['zone_h'], $data2['zone_m'], $data2['lon_h'], $data2['lon_m'], $data2['lat_h'], $data2['lat_m'], $data2['dst'], $data2['lon_e'], $data2['lat_s']);
$pts = $Kundali->getpoints($returnArrFrom[9], $returnArrTo[9]);
$finalPoints = array('points' => $pts, 'result' => $Kundali->interpret($pts));
return array($returnArrFrom, $returnArrTo, $finalPoints);
}
示例3: expense_voucher_detail
function expense_voucher_detail($voucher_id, $voucher_paid_from_account, $expense_type, $expense_detail, $expense_ammount, $expense_attachment)
{
$now = getDateTime(0, 'mySQL');
$insert = DB::Insert(DB_PREFIX . $_SESSION['co_prefix'] . 'voucher_expense_detail', array('voucher_id' => $voucher_id, 'expense_account_id' => $voucher_paid_from_account, 'expense_type' => $expense_type, 'expense_description' => $expense_detail, 'expense_amount' => $expense_ammount, 'has_attachment' => $expense_attachment, 'created_by' => $_SESSION['user_name'], 'created_on' => $now, 'voucher_detail_status' => 'Draft'));
$voucher_detail_id = DB::insertId();
if ($voucher_detail_id) {
return $voucher_detail_id;
return $voucher_id;
} else {
return 0;
}
}
示例4: setAttempt
/**
* set the appropriate attempt count for the row
* @param array $queueItem the database record for the queued item
* @return null
*/
protected function setAttempt($queueItem, $attempt)
{
$data = ["attempt_{$attempt}" => getDateTime()];
# if this was the final attempt
if ($attempt == 3) {
$data['failed_all_attempts'] = true;
$this->notifyAllFailed();
}
# update the database to reflect the attempt
DB::table($this->table)->where('id', $queueItem->id)->update($data);
# and request we re-queue the items
$this->requeue();
}
示例5: add_coa
function add_coa($account_code, $account_group, $account_desc_short, $account_desc_long, $parent_account_id, $account_type)
{
$consolidate_only = 0;
$activity_account = 0;
$has_parent = 0;
$has_children = 0;
$coa_level = 1;
$code_exists = 0;
$desc_exists = 0;
if ($parent_account_id != 0) {
$has_parent = 1;
}
if ($has_parent == 1) {
$coa_level = get_account_level($parent_account_id) + 1;
}
if ($account_type == "consolidate_only") {
$consolidate_only = 1;
}
if ($account_type == "activity_account") {
$activity_account = 1;
}
if (account_code_exists($account_code)) {
$code_exists = 1;
}
//check if account desc already exists
if (account_desc_exists($account_desc_short)) {
$desc_exists = 1;
}
if ($code_exists != 1 and $desc_exists != 1) {
$insert = DB::Insert(DB_PREFIX . $_SESSION['co_prefix'] . 'coa', array('account_code' => $account_code, 'account_group' => $account_group, 'account_desc_short' => $account_desc_short, 'account_desc_long' => $account_desc_long, 'activity_account' => $activity_account, 'consolidate_only' => $consolidate_only, 'has_parent' => $has_parent, 'coa_level' => $coa_level, 'has_children' => $has_children, 'parent_account_id' => $parent_account_id, 'last_modified_by' => $_SESSION['user_name'], 'last_modified_on' => getDateTime(date('now'), "mySQL"), 'created_by' => $_SESSION['user_name'], 'created_on' => getDateTime(date('now'), "mySQL"), 'account_status' => 'Active'));
$new_coa_id = DB::insertId();
if ($new_coa_id > 0 and $has_parent == 1) {
DB::update(DB_PREFIX . $_SESSION['co_prefix'] . 'coa', array('has_children' => 1), "account_id=%s", $parent_account_id);
}
return $new_coa_id;
} else {
return "0";
}
}
示例6: findCity
//$horo = new Models_Horo();
$city = findCity($_GET['city_id']);
//clearing user sql
$modelGeneral->clearCache($userSql);
//updating the city
if ($uid == $_SESSION['user']['id']) {
$data = array();
$md5Check = md5($userDetails['horo_cities']);
$horo_cities[$city['id']] = $city['name'];
$data['horo_cities'] = json_encode($horo_cities);
$md5Check2 = md5($data['horo_cities']);
if ($md5Check != $md5Check2) {
updateSettings($_SESSION['user']['id'], $data);
}
}
$fromDate = getDateTime($_GET['from_date']);
$date = $fromDate['year'] . '-' . $fromDate['month'] . '-' . $fromDate['day'];
$past = '';
$returnResult = array();
for ($counter = 0; $counter < $_GET['no_days']; $counter++) {
$day = date('d', strtotime("{$date} +{$counter} day"));
$month = date('m', strtotime("{$date} +{$counter} day"));
$year = date('Y', strtotime("{$date} +{$counter} day"));
for ($j = 0; $j < 24; $j = $j + 1) {
$hour = $j;
$dob = $year . '-' . $month . '-' . $day . ' ' . $hour . ':00:00';
$data2 = array_merge($city, array('dob' => $dob));
$result = $horo->match($userDetails, $data2);
if ($past == $result[1][9]) {
continue;
} else {
示例7: Date
$js_global = '';
$js_global .= '<script type="text/javascript" src="' . DOMAIN_STATIC . '/themes' . $_version . '/pc/js/jquery.min.js?v=' . $cache_version . '"></script>';
$js_global .= '<script type="text/javascript" src="' . DOMAIN_STATIC . '/themes' . $_version . '/pc/js/bootstrap.min.js?v=' . $cache_version . '"></script>';
$js_global .= '<script type="text/javascript" src="' . DOMAIN_STATIC . '/themes' . $_version . '/tuthuoc/js/tuthuoc.js?v=' . $cache_version . '"></script>';
//google analytics
if (!DEBUG_LOCAL) {
$js_global .= '<script>
(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,"script","//www.google-analytics.com/analytics.js","ga");
ga("require","displayfeatures");
ga("create", "UA-55614065-1", "auto");
ga("send", "pageview");
</script>';
$js_global .= '<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&appId=1561038610796934&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));</script>';
$js_global .= '<script lang="javascript">
(function() {var _h1= document.getElementsByTagName("title")[0] || false;
var product_name = ""; if(_h1){product_name= _h1.textContent || _h1.innerText;}var ga = document.createElement("script"); ga.type = "text/javascript";
ga.src = "//live.vnpgroup.net/js/web_client_box.php?hash=5fae10239172918a62dab2e4d330c339&data=eyJoYXNoIjoiODY5ZmViOWVhOWYxOGViZDNlNDhhNmZhMDQ3NjdkMWMiLCJzc29faWQiOjExM30-&pname="+product_name;
var s = document.getElementsByTagName("script");s[0].parentNode.insertBefore(ga, s[0]);})();
</script>';
}
$tpl_constants = array('css_global' => $css_global, 'js_global' => $js_global, 'loading_image' => '<span class="fa fa-refresh fa-spin"></span>', 'string_time' => getDateTime(), 'string_wday' => getDateTime(1, 1, 0, 0, ''), 'string_date' => 'Ngày ' . date('d/m'), 'fanpage_link' => 'https://www.facebook.com/suckhoeankhang');
示例8: foreach
foreach ($client_comments as $comment) {
?>
<div class="box-comment">
<img class="img-circle img-sm" alt="User Image" src="<?php
echo get_user_avatar_url($comment['created_by'], '50');
?>
" />
<div class="comment-text">
<span class="username">
<?php
echo get_user_full_name($comment['created_by']);
?>
<span class="text-muted pull-right">
<?php
echo getDateTime($comment['created_on'], "dtShort");
?>
</span>
</span>
<?php
echo $comment['comment'];
?>
</div>
</div>
<?php
}
} else {
echo '<div class="box-comment"><div class="comment-text">No Client Notes Added</div></div>';
}
?>
示例9: getPostVars
/**
* Check Post-Vars und Data Validation
*
* @return Boolean
*/
function getPostVars()
{
$todo_foo = new todo_foo();
$event = true;
if (empty($_POST['todotitle'])) {
$this->errors[] = 'err_100';
$event = false;
} else {
$todo_foo->todo_title = clearVars($_POST['todotitle']);
}
if (empty($_POST['todoprio'])) {
$this->errors[] = 'err_101';
$event = false;
} else {
$todo_foo->todo_prio = clearVars($_POST['todoprio']);
}
if (!empty($_POST['todostart'])) {
$todo_foo->todo_start = getDateTime($_POST['todostart']);
$todo_foo->show_start = $_POST['todostart'];
}
if (!empty($_POST['todofinish'])) {
$todo_foo->todo_finish = getDateTime($_POST['todofinish'], true);
$todo_foo->show_finish = $_POST['todofinish'];
}
if (!empty($_SESSION['edit_todo_id'])) {
$todo_foo->todo_id = (int) $_SESSION['edit_todo_id'];
}
if (!empty($_POST['movefield'])) {
$todo_foo->move = $_POST['movefield'];
}
if (!empty($_POST['todoproject'])) {
$todo_foo->todo_pr_id = $_POST['todoproject'];
} else {
$todo_foo->todo_pr_id = '0';
}
$todo_foo->todo_warndiff = isset($_POST['todowarndiff']) ? $_POST['todowarndiff'] : 0;
$todo_foo->todo_privat = isset($_POST['todoprivat']) ? $_POST['todoprivat'] : 0;
if (!empty($_POST['tododof'])) {
$todo_foo->todo_statusbar = $_POST['tododof'];
}
if (isset($_POST['todoagreed'])) {
$todo_foo->todo_status = $_POST['todoagreed'];
}
if (!empty($_POST['todocomment'])) {
$todo_foo->todo_comment = clearVars($_POST['todocomment']);
}
$this->todo_foo = $todo_foo;
return $event;
}
示例10: unset
unset($db_detail);
if (!$detail_data) {
error_404_document();
}
//tăng view cho tin
$db_update_view = new db_execute('UPDATE news SET new_view = new_view + 1 WHERE new_id = ' . $iNews);
unset($db_update_view);
//lấy chi tiết tin
$sql_news_content = 'SELECT ndt_content FROM news_detail WHERE ndt_id = ' . $iNews;
$db_content = new db_query($sql_news_content);
$row = mysqli_fetch_assoc($db_content->result);
unset($db_content);
$detail_data['new_detail'] = $row['ndt_content'];
$datetime_facebook = $detail_data['new_date'];
$datetime_detail_timestamp = $detail_data['new_date'];
$detail_data['new_date'] = getDateTime(1, 1, 1, 1, '', $detail_data['new_date']);
$detail_data['link_cat'] = generate_cat_url($detail_data);
$detail_data['new_picture'] = get_picture_path($detail_data['new_picture'], 'large');
$detail_data['facebook_share_link'] = 'http://khang.vn' . generate_news_detail_url($detail_data);
$detail_data['facebook_social'] = array();
$detail_data['facebook_social']['like'] = get_facebook_like_button($detail_data['facebook_share_link']);
$detail_data['facebook_social']['comment'] = get_facebook_comment_frame($detail_data['facebook_share_link']);
$detail_data['facebook_social']['embed'] = get_facebook_embedded_post($detail_data['facebook_share_link']);
$detail_data['new_teaser'] = $detail_data['new_teaser'] ? $detail_data['new_teaser'] : cut_string(removeHTML($detail_data['new_detail']), 200, '...');
$color_cat = get_color_category($detail_data['cat_id']);
$rainTpl->assign('color_cat', $color_cat);
$rainTpl->assign('page_title', $detail_data['new_title']);
$rainTpl->assign('detail_data', $detail_data);
//query ra các tin cùng chuyên mục
$sql_cat_list_news = 'SELECT new_id,
new_picture,
示例11: errorLog
function errorLog(string $msg)
{
logError("[err]{$msg};request ip:" . onLineIp() . ";url:" . getUrl() . ";ReferUrl:" . getReferUrl() . ";time:" . getDateTime());
// throw new Exception("[err]$msg;request ip:".onLineIp().";url:".getUrl().";ReferUrl:".getReferUrl().";time:".getDateTime());
}
示例12: getDateTime
<abbr class="timeago" title="<?php
echo $company['last_modified_on'];
?>
">
</abbr></td>
<td width="65%"><p><strong>Last modified</strong> by User :<b>[ <?php
echo $company['last_modified_by'];
?>
]</b> at <b>[ <?php
echo getDateTime($company['last_modified_on'], 'dtLong');
?>
]</b>. Record was <b>first created</b> by User : <b>[ <?php
echo $company['created_by'];
?>
]</b> at <b>[ <?php
echo getDateTime($company['created_on'], 'dtShort');
?>
]</b>. Company <b>Status</b> is<b> [ <?php
echo $company['company_status'];
?>
] </b>. Click here to view history of changes to company ID: <strong><?php
echo $company['company_id'];
?>
</strong> .
</p>
</td>
</tr>
</tbody>
</table>
示例13: detail
function detail()
{
# form validation settings
$rules = array(array('field' => 'body', 'label' => 'Comment', 'rules' => 'trim|required|min_length[3]|max_length[1500]|htmlspecialchars|xss_clean'));
$this->form_validation->set_message('required', '%s required');
$this->form_validation->set_message('min_length', '%s too short');
$this->form_validation->set_message('max_length', '%s too long');
$this->form_validation->set_rules($rules);
# valid input
if ($this->form_validation->run() == TRUE) {
# verify humanity and redirect if bot
if ($_POST['human'] != "") {
redirect('shout');
} else {
# remove value from array
unset($_POST['human']);
}
# get IP
$ip = $_SERVER['REMOTE_ADDR'];
# seed array with post data and extend
$data = $_POST;
$data['ip'] = $ip;
$data['date'] = getDateTime();
# format urls and mailtos: auto_link([input string], [url, email, both], [open links in new window?])
$data['body'] = auto_link($data['body'], 'both', TRUE);
$this->db->insert('comments', $data);
$this->db->update('submissions', array('lastpost' => getDateTime()), array('id' => $data['submission_id']));
redirect('shout/detail/' . $data['submission_id']);
}
# get comments
$data['submission_id'] = $this->uri->segment(3);
# verify that shout exists before continuing
$this->db->where('id', $data['submission_id']);
$results = $this->db->count_all_results('submissions');
if ($results < 1) {
redirect('shout');
}
# prep pagination
$config['per_page'] = '10';
$config['uri_segment'] = 5;
$config['base_url'] = base_url() . 'shout/detail/' . $data['submission_id'] . '/more';
$config['first_link'] = '';
$config['last_link'] = '';
$config['prev_link'] = '← Newer';
$config['next_link'] = 'Older →';
$config['full_tag_open'] = "<div id='page_nav_links'>";
$config['full_tag_close'] = "</div>";
$this->db->select('id');
$this->db->where('submission_id', $data['submission_id']);
$config['total_rows'] = $this->db->count_all_results('comments');
$this->pagination->initialize($config);
# get uri data
$data['db_offset'] = $this->uri->segment(5);
# get(table, limit, offset)
$this->db->select('id, body, ip, date');
$this->db->where('submission_id', $data['submission_id']);
$this->db->order_by("date", "desc");
$data['comments'] = $this->db->get('comments', $config['per_page'], $data['db_offset']);
$data['before'] = $config['total_rows'];
$data['after'] = $data['comments']->num_rows;
$data['pageNavLinks'] = $this->pagination->create_links();
# get the shout's content
$this->db->select('id, title, body, ip, date');
$data['shout'] = $this->db->get_where('submissions', array('id' => $data['submission_id']));
# finally...
$this->load->view('detail_view', $data);
}
示例14: sin
case 1:
$tip = "sin(60 is" . sin(6);
break;
case 2:
$tip = "The square root of {$r} is " . sqrt($r);
break;
case 3:
$tip = "987654321 is formatted to " . number_format('987654321', $r, '.', ',');
break;
case 4:
$tip = "Your digital ID is " . uniqid();
break;
case 5:
$tip = "2<sup>{$r}</sup> is " . pow(2, $r);
break;
case 6:
$tip = "{$r} in binary format is " . decbin($r);
break;
default:
$tip = "Natural logarithms, <i>e</i>, to the power of {$r} is " . exp($r);
break;
}
echo $tip;
echo "<hr size='1'>";
function getDateTime()
{
date_default_timezone_set("America/Los_Angeles");
echo date('l jS \\of F Y h:i:s A');
}
getDateTime();
示例15: compatibleDateTimes
function compatibleDateTimes($baseArray, $otherArray)
{
$baseDates = getDateTime($baseArray);
$otherDates = getDateTime($baseArray);
$found = true;
for ($i = 1; $i < count($baseDates) && $found; $i++) {
//for each item in base array, search for its counterpart; stop searching if one entry cannot be found
$found = false;
for ($j = 0; $j < count($otherDates) && !$found; $j++) {
//keep searching if the element has not been found
if ($baseDates[$i] == $otherDates[$j]) {
$found = true;
}
}
}
return $found;
}