本文整理汇总了PHP中DateTimeFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeFormat函数的具体用法?PHP DateTimeFormat怎么用?PHP DateTimeFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DateTimeFormat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createXls
function createXls()
{
$page = getQUERY("page");
$from = getQUERY("from");
$page1 = $page;
$req = getQUERY("req");
$req1 = str_replace("**", "&", $req);
$url = "";
$temp = explode("&", $req1);
$cid = getQUERY("c");
$uid = getQUERY("u");
$sd = substr($temp[1], 3);
$ed = substr($temp[2], 3);
$lang = substr($temp[0], 2);
opendb();
/* format na datum */
$datetimeformat = dlookup("select datetimeformat from users where id=" . $uid);
//'Y-m-d h:i:s a'; //
$datfor = explode(" ", $datetimeformat);
$dateformat = $datfor[0];
$timeformat = $datfor[1];
if ($timeformat == "H:i:s") {
$e_ = " 23:59";
$e1_ = "_23:59";
$s_ = " 00:00";
$s1_ = "_00:00";
$tf = " H:i";
} else {
$e_ = " 11:59 PM";
$e1_ = "_11:59_PM";
$s_ = " 12:00 AM";
$s1_ = "_12:00_AM";
$tf = " h:i a";
}
$sdG = DateTimeFormat($sd, 'd-m-Y H:i:s');
$edG = DateTimeFormat($ed, 'd-m-Y H:i:s');
/* format na datum */
$nameXls = $page1 . '_' . $cid . '_' . DateTimeFormat($sdG, $dateformat) . $s1_ . '_' . DateTimeFormat($edG, $dateformat) . $e1_ . '.xls';
$url = $page . "1.php?l=" . $lang . "&u=" . $uid . "&c=" . $cid . "&sd=" . DateTimeFormat($sd, "d-m-Y") . "%2000:00:00&ed=" . DateTimeFormat($ed, "d-m-Y") . "%2023:59:00&from=s";
closedb();
if ($from == "s") {
$handle = fopen('../savePDF/' . $nameXls, 'w+') or die('Cannot open file: ' . $nameXls);
$data = file_get_contents("http://panorama.gps.mk/settings/" . $url);
fwrite($handle, $data);
fclose($handle);
echo $nameXls;
}
}
示例2: __construct
public function __construct($AdminID = '')
{
$this->Connect();
$this->AdminID = $AdminID == '' ? $_SESSION['admin_id'] : $AdminID;
$this->AdminData = $this->fetchAssoc('admin_user', '*', "admin_id = '" . $this->AdminID . "'");
$this->AdminData = $this->AdminData[0];
$this->FirstName = $this->AdminData['first_name'];
$this->LastName = $this->AdminData['last_name'];
$this->User = $this->AdminData['user'];
$this->ProfileID = $this->AdminData['profile_id'];
$this->Img = file_exists($this->AdminData['img']) ? $this->AdminData['img'] : $this->DefaultImg;
$this->FullName = $this->FirstName . " " . $this->LastName;
$this->FullUserName = $this->FirstName . " " . $this->LastName . " (" . $this->User . ")";
$this->LastAccess = "Último acceso: " . DateTimeFormat($this->AdminData['last_access']);
$ProfileData = $this->fetchAssoc('admin_profile', '*', " profile_id = " . $this->ProfileID);
$this->ProfileName = $ProfileData[0]['title'];
}
示例3: dic
%; font-size:11px; padding-left:3px" align="left" class="corner5 text5 <?php
echo $classTr;
?>
colZone"><span id="spanZone-<?php
echo $drVehicle["id"];
?>
" onmousemove="ShowPopup(event, '<span class=\'text5\'><?php
echo dic("Reports.CurrZone");
?>
</span>')" onmouseout="HidePopup()"><?php
echo nnull(pg_fetch_result($dsCurrPos, 0, "zonenames"), "/");
?>
</span></td>
<?php
if ($clientType == 2) {
$dsTaxiData = query("select count(*) cnt, sum(price) price, sum(pricewith) pricewith from reporttaxi where vehicleid=" . $drVehicle["id"] . " and startdate between '" . DateTimeFormat(now(), "Y-m-d 00:00:00") . "' and '" . DateTimeFormat(now(), "Y-m-d H:i:s") . "'");
?>
<td style="<?php
echo $dntoursS;
?>
; width:6%; font-size:11px;" align="center" class="corner5 text5 <?php
echo $classTr;
?>
colNTours">
<span id="spanCntTours-<?php
echo $drVehicle["id"];
?>
" onmousemove="ShowPopup(event, '<span class=\'text5\'><?php
echo dic("Reports.TotalToursDay");
?>
</span>')" onmouseout="HidePopup()"><?php
示例4: str_replace
* 9 - празник за еврејската заедница
* 10 - празник за бошњачката заедница
* 11 - празник за турската заедница
*
*/
$imePraznik = str_replace("'", "''", NNull($_GET['imePraznik'], ''));
$datum = DateTimeFormat(getQUERY("Datum"), 'Y-m-d');
opendb();
$tipDen = str_replace("'", "''", NNull($_GET['tipDen'], ''));
//$den = str_replace("'", "''", NNull($_GET['den'], ''));
$den = dlookup("select getdayofweek(cast('" . $datum . "' as date))");
$color = str_replace("'", "''", NNull($_GET['boja'], ''));
$tipPraznik = str_replace("'", "''", NNull($_GET['tipPraznik'], ''));
if ($tipDen == 8) {
$proverka = query("select * from companydays");
if (pg_num_rows($proverka) == 0) {
$vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor\t,typeofholiday) values(1," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "','" . $tipPraznik . "'); ");
} else {
$posledno = dlookup("select Max(id)+1 from companydays");
$vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor,typeofholiday) values('" . $posledno . "'," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "','" . $tipPraznik . "'); ");
}
} else {
$proverka = query("select * from companydays");
if (pg_num_rows($proverka) == 0) {
$vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor) values(1," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "'); ");
} else {
$posledno = dlookup("select Max(id)+1 from companydays");
$vnes = query("insert into companydays(id,clientid,dayname,typeofday,datum,companyholiday,cellcolor) values('" . $posledno . "'," . Session("client_id") . ",N'" . $imePraznik . "','" . $den . "','" . DateTimeFormat($datum, "Y-m-d") . "','" . $tipDen . "','#" . $color . "'); ");
}
}
closedb();
示例5: DateTimeFormat
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="../js/share.js"></script>
<script type="text/javascript" src="../js/iScroll.js"></script>
<script type="text/javascript" src="../js/jquery-ui.js"></script>
<script type="text/javascript" src="fm.js"></script>
<link href="../css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" type="text/css" />
<!--script src="js/jquery-ui-timepicker-addon.js" type="text/javascript"></script-->
<script src="../js/jquery-ui.js"></script>
<script src="../js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<body>
<?php
$LastDay = DateTimeFormat(addDay(-1), "d-m-Y");
$vehID_ = getQUERY("vehid");
$tpoint = getQUERY("tpoint");
opendb();
$reg = "";
//dlookup("select registration from vehicles where id=" . $vehID);
$cLang = getQUERY("l");
?>
<table class="text2_" width=400px align="center" style="padding-top: 13px; margin-left:60px">
<tr>
<td width=160px style="font-size:13px" ><b><?php
echo dic_("Reports.ChooseCost");
?>
:</b></td>
<td style="padding-left:0px">
示例6: DateTimeFormat
echo $img;
?>
" style="">
</td>
<td width=65%><strong id="sent-name-<?php
echo $cc;
?>
"><?php
echo $to;
?>
</strong></td>
<td width=35% id="sent-datetime-<?php
echo $cc;
?>
"><?php
echo DateTimeFormat($drMessInbox["datetime"], $dateformat);
?>
</td>
</tr>
<!--<tr style="color:#8c8c8c"><td id="sent-subject-<?php
echo $cc;
?>
" colspan=3 ><?php
echo $drMessInbox["subject"];
?>
</td></tr>-->
<tr style="color:#8c8c8c"><td id="sent-body-<?php
echo $cc;
?>
" colspan=3 style="font-style:italic;"><?php
echo substr($drMessInbox["body"], 0, 70);
示例7: query
} else {
//vikend
if ($dayType == 9) {
if (DateTimeFormat($f, 'w') == 6 or DateTimeFormat($f, 'w') == 0) {
$ret = query("select cachereportsparams('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')");
if ($clienttypeid == 2) {
$ret = query("select cachetaxiparams1('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')");
$ret = query("select cachetaxiparams2('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')");
}
}
} else {
//delnik
if ($dayType == 10) {
if (DateTimeFormat($f, 'w') >= 1 and DateTimeFormat($f, 'w') <= 5) {
$ret = query("select cachereportsparams('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')");
if ($clienttypeid == 2) {
$ret = query("select cachetaxiparams1('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')");
$ret = query("select cachetaxiparams2('" . DateTimeFormat($f, 'Y-m-d') . " " . $from . "', '" . DateTimeFormat($f, 'Y-m-d') . " " . $to . "', ' clientid = " . $cid . "')");
}
}
}
}
}
$f = addToDate($f, 1, "days");
}
}
}
closedb();
?>
示例8: DateTimeFormat
<img id="act<?php
echo $cnt;
?>
" width= "11px" height = "11px" src="<?php
echo $greenCard;
?>
" />
</td>
<td id="td-6-<?php
echo $cnt;
?>
" align="center" class="td-row text2" style="color:<?php
echo $color;
?>
"><?php
echo DateTimeFormat($lastDate, $datetimeformat);
?>
</td>
<td id="td-9-<?php
echo $cnt;
?>
" align="center" class="td-row text2 <?php
echo $paren;
?>
">
<img id="act<?php
echo $cnt;
?>
" width= "11px" height = "11px" src="<?php
echo $activity;
示例9: getQUERY
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
$gsm = getQUERY("gsm");
opendb();
$vehicleid = dlookup("select id from vehicles where gsmnumber='" . $gsm . "'");
$r = runSQL("insert into cameravehicle (vehicleid, datetime) values(" . $vehicleid . ", '" . now() . "')");
echo dlookup("select count(*) from cameravehicle where vehicleid=" . $vehicleid . " and datetime between '" . DateTimeFormat(now(), '"Y-m-d 00:00:00"') . "' and '" . DateTimeFormat(now(), '"Y-m-d 23:59:59"') . "'");
closedb();
示例10: explode
$activity = "../images/stikla3.png";
}
$_lastReg = explode(" ", DateTimeFormat($drOV["lastregistration"], "d-m-Y"));
$lastReg = $_lastReg[0];
$fuelType1 = query("select name from fueltypes where id = (select fueltypeid from vehicles where id=" . $drOV["id"] . ")");
$row2 = pg_fetch_array($fuelType1);
//$lastDate = nnull(dlookup('select "DateTime" from currentposition where vehicleid=' . $drOV["id"]), "/");
$ld = query('select "DateTime" from currentposition where vehicleid=' . $drOV["id"]);
if (pg_num_rows($ld) > 0)
$lastDate = nnull(pg_fetch_result($ld, 0, 0), "/");
else
$lastDate = "/";
if ($lastDate <> "/") $lastDate = DateTimeFormat($lastDate, 'd-m-Y H:i:s');
$color = "";
if ($lastDate <> "/") {
if (round(abs(strtotime(now())-strtotime($lastDate))/60) > 1440) $color = "red";
else $color = "green";
}
?>
<tr id="veh<?php echo $cnt_1 ?>" style="" onmouseover="over(<?php echo $cnt_ ?>, 1, <?php echo $actYN ?>)" onmouseout="out(<?php echo $cnt_ ?>, 1, <?php echo $actYN ?>)">
<td id="_td-1-<?php echo $cnt_ ?>" width="6%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; "><?php echo $drOV["code"] ?></td>
<td id="_td-2-<?php echo $cnt_ ?>" width="13%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><strong><?php echo $drOV["registration"] ?></strong><br> <?php if($zaAlias>0){ ?><font style="font-size:10px">(<?php echo $drOV["alias"];?>)</font><?php }else{ echo "";}?></td>
<td id="_td-3-<?php echo $cnt_ ?>" width="16%" height="30px" align="center" class="text2 <?php echo $paren?>" style="background-color:#fff; border:1px dotted #B8B8B8;">
<b><?php echo $drOV["model"]?></b><br>
<?php if($row2["name"]=="Бензин")
{
?>
示例11: DateTimeFormat
?>
</p></div>
<div class="col-md-2 col-sm-2 col-xs-12"><p><?php
echo $User['password'];
?>
</p></div>
<div class="col-md-2 col-sm-2 col-xs-12"><p><?php
echo $User['email'];
?>
</p></div>
<div class="col-md-2 col-sm-2 col-xs-12"><p><?php
echo $User['site_status'];
?>
</p></div>
<div class="col-md-3 col-sm-3 col-xs-12"><p><?php
echo DateTimeFormat($User['creation_date']);
?>
</p></div>
<div class="col-md-1 col-sm-1 col-xs-12"><p><?php
echo $User['id'];
?>
</p></div>
</div>
<?php
}
?>
<!-- /User (List) -->
</div><!-- /User List View -->
<?php
foreach ($Users as $User) {
$User = new AdminData($User['admin_id']);
示例12: opendb
<?php
include "../include/functions.php";
include "../include/db.php";
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
opendb();
$t = getQUERY("t");
$cntCompanyHoliday = dlookup("select count(*) from companydaysholiday where clientid=" . session("client_id") . " and holidayid=1");
if ($cntCompanyHoliday == 0) {
$ret = RunSQL("insert into companydaysholiday (clientid, nameholiday, holidayid) values (" . session("client_id") . ", 'Државен', 1)");
}
if ($t == 1) {
$sqlCompanyDays = "insert into companydays (clientid, dayname, typeofday, datum, companyholiday, cellcolor, typeofholiday)\n\t\tselect " . session("client_id") . ", description, (select getdayofweek(cast(datetime as date))), datetime1, 8, '#ff9933', 1 \n\t\tfrom nonworkingdays where description not in (select dayname from companydays where clientid=" . session("client_id") . " and datum >= '" . DateTimeFormat(now(), 'Y') . '-01-01' . "' and datum <= '" . DateTimeFormat(now(), 'Y') . '-12-31' . "')\n\t\tand active='1'";
$ret1 = RunSQL($sqlCompanyDays);
} else {
$sqlCompanyDays1 = "delete from companydays where clientid=" . session("client_id") . " and datum >= '" . DateTimeFormat(now(), 'Y') . '-01-01' . "' and datum <= '" . DateTimeFormat(now(), 'Y') . '-12-31' . "' and companyholiday = 8";
$ret2 = RunSQL($sqlCompanyDays1);
}
closedb();
示例13: dic_
{
?>
(<font style="font-size:10px"><?php echo dic_("Diesel")?></font>)
<?php
}
if($row2["name"]=="LPG")
{
?>
(<font style="font-size:10px"><?php echo dic_("LPG")?></font>)
<?php
}
?>
</div>
<td id="_td-4-<?php echo $cnt_ ?>" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php echo DateTimeFormat($drOV["lastregistration"], $dateformat) ?></td>
<td id="_td-5-<?php echo $cnt_ ?>" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><img id="_act<?php echo $cnt_?>" src=<?php echo $greenCard ?> width = "11px" height = "11px"/></td>
<td id="_td-6-<?php echo $cnt_ ?>" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8; color:<?php echo $color?>"><?php echo DateTimeFormat($lastDate, $datetimeformat)?></td>
<!--
<?php
$fm = dlookup("select allowedfm from clients where id=" . session("client_id"));
if ($fm == '1' and session("role_id") == 2) {
?>
<td id="_td-7-<?php echo $cnt_ ?>" width="8%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;">
<button id="_costBtn-<?php echo $cnt_?>" onclick="costVehicle(<?php echo $cnt_1 ?>, <?php echo $id ?>, '<?php echo $drOV["registration"] ?> (<?php echo $drOV["code"] ?>) <?php echo $drOV["alias"] ?>')" style="height:22px; width:30px"></button>
</td>
<?
}
?>
-->
<td id="_td-9-<?php echo $cnt_ ?>" height="30px" align="center" class="text2 <?php echo $paren ?>" style="background-color:#fff; border:1px dotted #B8B8B8;">
<img id="_act<?php echo $cnt_?>" src=<?php echo $activity?> width = "11px" height = "11px"/>
<!--<button id="_delBtn-<?php echo $cnt_ ?>" onclick="del(<?php echo $drOV["id"] ?>, '<?php echo $cLang ?>', 'vehicles')" style="height:22px; width:30px"></button>-->
示例14: If
If ($greenCard == false) {
$greenCard = 0;
} else{
$greenCard = 1;
}
If ($activity == false) {
$activity = 0;
} else{
$activity = 1;
}
$chassis = nnull(dlookup("select chassisnumber from vehicles where id=" . $id), "");
$motor = nnull(dlookup("select motornumber from vehicles where id=" . $id), "");
$capacity = nnull(dlookup("select fuelcapacity from vehicles where id=" . $id), "0");
$firstReg = DateTimeFormat(nnull(dlookup("select firstregistration from vehicles where id=" . $id), now()), $dateformat);
$kmPerYear = nnull(dlookup("select kmperyear from vehicles where id=" . $id), "0"); //godisno dozvoleni km
$springT = nnull(dlookup("select springtires from vehicles where id=" . $id), "30000"); //predvideni km za letni gumi
$winterT = nnull(dlookup("select wintertires from vehicles where id=" . $id), "30000"); //predvideni km za zimski gumi
$nextService= nnull(dlookup("select nextservice from vehicles where id=" . $id), "10000"); //na kolku km se vrsi servis
if ($metric == 'mi') {
$nextService = $nextService / 1.609344498;
}
$nextServiceMonths= nnull(dlookup("select nextservicemonths from vehicles where id=" . $id), "12"); //na kolku meseci se vrsi servis
$gorivo = nnull(dlookup("select fueltypeid from vehicles where id=" . $id), "");
$range = 0;
if($clienttypeid == 4)
{
示例15: DateTimeFormat
" width="16%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php
echo DateTimeFormat($drOD["borndate"], $dateformat);
?>
</td>
<td id="_td-5-<?php
echo $cnt_;
?>
" width="12%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php
echo nnull($drOD["licensetype"], "/");
?>
</td>
<td id="_td-6-<?php
echo $cnt_;
?>
" width="15%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;"><?php
echo DateTimeFormat($drOD["licenseexp"], $dateformat);
?>
</td>
<td id="_td-7-<?php
echo $cnt_;
?>
" width="8%" height="30px" align="center" class="text2" style="background-color:#fff; border:1px dotted #B8B8B8;">
<button id="_modBtn-<?php
echo $cnt_;
?>
" onclick="modifyDriver(<?php
echo $cnt_1;
?>
, <?php
echo $id;
?>