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


PHP parseDate函数代码示例

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


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

示例1: changelogDate

 function changelogDate($version)
 {
     //
     $file = file('data/changelogs/' . $version . '.txt');
     $date = substr(trim($file[0]), 1, -1);
     $date = parseDate($date);
     return date('jS F, Y', $date);
 }
开发者ID:fewizz,项目名称:modlist,代码行数:8,代码来源:mods.php

示例2: parseDateTime

function parseDateTime($datetime)
{
    $reArr = array();
    $timeArr = array();
    list($date, $time) = explode(" ", $datetime);
    $reArr = parseDate($date);
    $timeArr = explode(":", $time);
    $reArr = array_merge($reArr, $timeArr);
    return $reArr;
}
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:10,代码来源:common.php

示例3: blockMoney

 function blockMoney($dabAccount, $idCardNo, $epsAccount, $orderID, $orderAmount, $orderDate)
 {
     if (!defined('DAB_TOOLS')) {
         return 0;
     }
     $function = "bid";
     $this->addSOAPHeader($function);
     $arrOrderDate = parseDate($orderDate);
     $sourceDate = $arrOrderDate[0] . $arrOrderDate[1] . $arrOrderDate[2] . date("His");
     $transferDate = $arrOrderDate[0] . $arrOrderDate[1] . $arrOrderDate[2];
     $result = $this->soapClient->call($function, $params = array('custaccount' => $dabAccount, 'CID' => $idCardNo, 'scraccount' => $epsAccount, 'refno' => $orderID, 'amount' => $orderAmount, 'scrdate' => $sourceDate, 'transferflag' => 0, 'transferdate' => $transferDate), $this->soapOptions);
     $content = date("d/m/Y H:i:s") . "\tcustaccount => {$dabAccount}, CID => {$idCardNo}, scraccount => {$epsAccount}, refno => {$orderID}, amount => {$orderAmount}, scrdate => {$sourceDate}, transferdate => {$transferDate} \t--> {$result}";
     write_log($function, $content, DAB_LOG_FILE_PATH);
     /*write_my_log_path('DAB-connect',$_SERVER['REMOTE_ADDR'].' function_name blockMoney custaccount '.$dabAccount.' CID '.$idCardNo.' epsAccount '.$epsAccount.' refno '.$orderID.' amount '.$orderAmount.' sourceDate '.$sourceDate.' transferdate '.$transferDate.'  ' .date('Y-m-d h:i:s'),DAB_PATH.'logs/');*/
     return $result;
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:16,代码来源:dab.php

示例4: saveMessage

function saveMessage($obj)
{
    global $MENSAGENS;
    //Salva a mensagem enviada pela text area
    $mensagem = $obj['mensagem'];
    unset($obj['mensagem']);
    $fileName = sprintf("messages/%s%s.json", parseDate($obj['data']), $obj['email']);
    $file = fopen($fileName, "w");
    fwrite($file, $mensagem);
    fflush($file);
    fclose($file);
    //Salva os dados de quem enviou a mensagem
    $msgsArr = getMessagesArray();
    $msgsArr[] = $obj;
    $json['mensagens'] = $msgsArr;
    $file = fopen($MENSAGENS, "w");
    fwrite($file, json_encode($json));
    fflush($file);
    fclose($file);
}
开发者ID:xlbruce,项目名称:fale-conosco,代码行数:20,代码来源:functions.php

示例5: parseHTTPDate

 /**
  * Parses a RFC2616-compatible date string
  *
  * This method returns false if the date is invalid
  *
  * @deprecated Use parseDate
  * @param string $dateHeader
  * @return bool|DateTime
  */
 static function parseHTTPDate($dateHeader)
 {
     return parseDate($dateHeader);
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:13,代码来源:Util.php

示例6: setDateEnd

 function setDateEnd($date_end = "", $time_end = "")
 {
     $datestring = parseDate($date_end . " " . $time_end);
     $this->date_end = substr($datestring, 0, 10);
     $this->time_end = substr($datestring, 11, 8);
 }
开发者ID:highchair,项目名称:hcd-trunk,代码行数:6,代码来源:event.php

示例7: while

while (date('W', $daystart) == date('W', $week_start)) {
    $weekdays[$i] = $daystart;
    $daystart += 86400;
    $i++;
}
echo '<table width="100%">' . chr(10);
foreach ($weekdays as $daynum => $weekday) {
    echo '<tr>' . chr(10);
    if ($daynum == 6 || $daynum == 7) {
        echo ' <td style="background-color: #FFFFCC;">' . chr(10);
    } else {
        echo ' <td>' . chr(10);
    }
    echo '<a class="graybg" href="day.php?year=' . date('Y', $weekday) . '&amp;month=' . date('m', $weekday) . '&amp;day=' . date('d', $weekday) . '&amp;area=' . $area . '&amp;room=' . $room . '">';
    echo '<b>' . ucfirst(strtolower(parseDate(strftime("%A", $weekday)))) . '</b>';
    echo '<br>' . ucfirst(strtolower(parseDate(strftime("%d. %B", $weekday))));
    echo '</td>' . chr(10);
    if ($daynum == 6 || $daynum == 7) {
        echo ' <td style="background-color: #FFFFCC;">' . chr(10);
    } else {
        echo ' <td>' . chr(10);
    }
    $entries = array();
    $timed_entries = array();
    foreach ($rooms as $room_id => $room) {
        $start = mktime(0, 0, 0, date('m', $weekday), date('d', $weekday), date('Y', $weekday));
        $end = mktime(23, 59, 59, date('m', $weekday), date('d', $weekday), date('Y', $weekday));
        $events_room = checktime_Room($start, $end, $area, $room_id);
        if (isset($events_room[$room_id])) {
            foreach ($events_room[$room_id] as $entry_id) {
                $event = getEntry($entry_id);
开发者ID:HNygard,项目名称:JM-booking,代码行数:31,代码来源:week.php

示例8: parseDate

include '../5d6s4fds65/db_params.php';
// Get birthday
$year = $_POST['year'];
$month = $_POST['month'];
$day = $_POST['day'];
$date = "{$year}/{$month}/{$day}";
// Parse date string into 0000-00-00
function parseDate($date)
{
    $timestamp = strtotime($date);
    $parsed = date("Y-m-d", $timestamp);
    return $parsed;
}
// Final string
$birth = parseDate($date);
$username = addslashes($_POST['username']);
$mail = addslashes($_POST['mail']);
$password = $_POST['password'];
$conn = mysqli_connect(HOST, USER, PASSWORD, DB);
$requete = "INSERT INTO users (mail, password, username, birth) VALUES ('{$mail}','{$password}','{$username}','{$birth}')";
if (!mysqli_query($conn, $requete)) {
    echo mysqli_error($conn);
}
if (!$conn) {
    die('Connexion impossible : ' . mysql_error());
    echo "failed";
} else {
    echo "success";
}
?>
开发者ID:GaelCoat,项目名称:serieManager,代码行数:30,代码来源:signIn.php

示例9: printLayOver

function printLayOver($firstid, $secondid)
{
    $layover = oci_fetch_row(executePlainSQL("select F2.departtime-F1.arrivaltime from Flight F1, Flight F2\n\t\t\t\t\t\t\t\t\twhere F1.fid='{$firstid}' AND F2.fid='{$secondid}'"));
    $layovertime = parseDate($layover[0], 2);
    echo "<br>Lay over for {$layovertime}";
}
开发者ID:holybom,项目名称:ubcair,代码行数:6,代码来源:oci_functions.php

示例10: printFlights

function printFlights($flights, $locations)
{
    echo "<p><br>Search Results: <br></p>";
    echo "<form method='POST' action='reservation.php'>";
    echo '<table class = "pure-table pure-table-bordered">';
    // print the top row (attribute labels)
    echo '<thead>';
    echo "<tr><th>Departure Airport</th><th>City</th><th>Country</th>" . "<th>Arrival Airport</th><th>City</th><th>Country</th><th>Departure Time (GMT)</th>" . "<th>Total Flight Time</th><th>COST (CAD)</th><th>Choose Flight</th></tr>";
    echo '</thead>';
    // print the data rows (tuples)
    $it = 0;
    while ($flight = OCI_Fetch_Array($flights, OCI_ASSOC)) {
        $printout = "<tr>";
        foreach ($locations as $value) {
            $printout = $printout . "<td>{$value}</td>";
        }
        $departtime = parseDate($flight['DT1'], 1);
        $flighttime = parseDate($flight['TOTALTIME'], 2);
        $cost = $flight['TOTALPRICE'];
        $fclassint = 0;
        // Variable costs depends on class
        if (strcmp($_COOKIE['flightclass'], "economy") == 0) {
            $cost *= 1;
            $fclassint = 1;
        } else {
            if (strcmp($_COOKIE['flightclass'], "business") == 0) {
                $cost *= 3;
                $fclassint = 3;
            } else {
                if (strcmp($_COOKIE['flightclass'], "first") == 0) {
                    $cost *= 5;
                    $fclassint = 5;
                }
            }
        }
        // update the cost if the class is changed
        $flight['TOTALPRICE'] = $cost;
        // Add class and num tickets to the post array
        $flight['CLASS'] = $_COOKIE['flightclass'];
        $flight['CLASSINT'] = $fclassint;
        $flight['NUMTICKETS'] = $_COOKIE['numtickets'];
        $flight_string = serialize($flight);
        echo $printout . "<td>{$departtime}</td><td>{$flighttime}</td><td>{$cost}</td>";
        echo "<td><input type='radio' name='flightchoice' value='{$flight_string}' required></td></tr>";
        echo "<tr><td>";
        printDetails($flight, $it, 1);
        echo "</td></tr>";
        $it++;
    }
    echo "</table>";
    echo "<input type='submit' value='Book my flight'></form>";
}
开发者ID:holybom,项目名称:ubcair,代码行数:52,代码来源:flights.php

示例11: Warn

                     Warn("Value {$uservalue} added to attribute {$att['2']}");
                     $user_att_value = Sql_Insert_Id();
                 } else {
                     $d = Sql_Fetch_Row($val);
                     $user_att_value = $d[0];
                 }
                 break;
             case "checkbox":
                 if ($uservalue && $uservalue != "off") {
                     $user_att_value = "on";
                 } else {
                     $user_att_value = "off";
                 }
                 break;
             case "date":
                 $user_att_value = parseDate($uservalue);
                 break;
             default:
                 $user_att_value = $uservalue;
                 break;
         }
         Sql_query(sprintf('replace into %s (attributeid,userid,value) values(%d,%d,"%s")', $tables["user_attribute"], $attribute_index, $userid, $user_att_value));
     } else {
         if ($item["record"] != "skip") {
             # add an empty entry if none existed
             Sql_Query(sprintf('insert ignore into %s (attributeid,userid,value) values(%d,%d,"")', $tables["user_attribute"], $item["record"], $userid));
         }
     }
 }
 $current_data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables["user"], $userid));
 $current_data = array_merge($current_data, getUserAttributeValues('', $userid));
开发者ID:alancohen,项目名称:alancohenexperience-com,代码行数:31,代码来源:importcsv.php

示例12: get_the_permalink

        echo 'id="next"';
    }
    ?>
>
			<a href="<?php 
    echo get_the_permalink();
    ?>
">
				<div class="hidden-sm hidden-xs hidden-md cd-timeline-img cd-picture <?php 
    if ($post->ID == $nextEvent) {
        echo 'next-project';
    }
    ?>
">
					<span><?php 
    echo parseDate($date);
    ?>
</span>
				</div>
			</a> <!-- cd-timeline-img -->
			<div class="mobile-no-margin cd-timeline-content <?php 
    echo $class . '-wrap';
    ?>
 <?php 
    if ($j == 0) {
        echo 'first';
    }
    ?>
">
			
				<div class="wow animated slideInUp">
开发者ID:eq0rip,项目名称:srijanalaya,代码行数:31,代码来源:archive-project.php

示例13: parseDate

 if ($_contestant1birthdate != "NULL") {
     $_contestant1birthdate = '"' . $_contestant1birthdate . '"';
 }
 $_contestant2passportdate = parseDate($contestant2passportdate);
 if ($_contestant2passportdate != "NULL") {
     $_contestant2passportdate = '"' . $_contestant2passportdate . '"';
 }
 $_contestant2birthdate = parseDate($contestant2birthdate);
 if ($_contestant2birthdate != "NULL") {
     $_contestant2birthdate = '"' . $_contestant2birthdate . '"';
 }
 $_contestant3passportdate = parseDate($contestant3passportdate);
 if ($_contestant3passportdate != "NULL") {
     $_contestant3passportdate = '"' . $_contestant3passportdate . '"';
 }
 $_contestant3birthdate = parseDate($contestant3birthdate);
 if ($_contestant3birthdate != "NULL") {
     $_contestant3birthdate = '"' . $_contestant3birthdate . '"';
 }
 if (isFullFilled($fill)) {
     $fullfilled = 1;
 } else {
     $fullfilled = 0;
 }
 $query = "insert into teams(teamname, city, studyplace, address, phone, fax,\n          contactname, contactphone, contactmail,\n          headname, headpost,\n          headpassportno, headpassportplace, headpassportdate, headbirthdate, headaddress, headinn,\n          coachname, coachpost,\n          coachpassportno, coachpassportplace, coachpassportdate, coachbirthdate, coachaddress, coachinn,\n          contestant1name,\n          contestant1studyplace, contestant1faculty, contestant1classcourse, contestant1age,\n          contestant1passportno, contestant1passportplace, contestant1passportdate,\n          contestant1birthdate, contestant1address, contestant1inn,\n          contestant2name,\n          contestant2studyplace, contestant2faculty, contestant2classcourse, contestant2age,\n          contestant2passportno, contestant2passportplace, contestant2passportdate, \n          contestant2birthdate, contestant2address, contestant2inn,\n          contestant3name,\n          contestant3studyplace, contestant3faculty, contestant3classcourse, contestant3age,\n          contestant3passportno, contestant3passportplace, contestant3passportdate,\n          contestant3birthdate, contestant3address, contestant3inn,\n          `password`, contestteamid,\n          language,\n          fullfilled)\n        values(\"{$teamname}\", \"{$city}\", \"{$studyplace}\", \"{$address}\", \"{$phone}\", \"{$fax}\",\n          \"{$contactname}\", \"{$contactphone}\", \"{$contactmail}\",\n          \"{$headname}\", \"{$headpost}\",\n          \"{$headpassportno}\", \"{$headpassportplace}\", " . $_headpassportdate . ",\n          " . $_headbirthdate . ", \"{$headaddress}\", \"{$headinn}\",\n          \"{$coachname}\", \"{$coachpost}\",\n          \"{$coachpassportno}\", \"{$coachpassportplace}\", " . $_coachpassportdate . ",\n          " . $_coachbirthdate . ", \"{$coachaddress}\", \"{$coachinn}\",\n          \"{$contestant1name}\",\n          \"{$contestant1studyplace}\", \"{$contestant1faculty}\", \"{$contestant1classcourse}\", {$contestant1age},\n          \"{$contestant1passportno}\", \"{$contestant1passportplace}\", " . $_contestant1passportdate . ",\n          " . $_contestant1birthdate . ", \"{$contestant1address}\", \"{$contestant1inn}\",\n          \"{$contestant2name}\", \n          \"{$contestant2studyplace}\", \"{$contestant2faculty}\", \"{$contestant2classcourse}\", {$contestant2age},\n          \"{$contestant2passportno}\", \"{$contestant2passportplace}\", " . $_contestant2passportdate . ",\n          " . $_contestant2birthdate . ", \"{$contestant2address}\", \"{$contestant2inn}\",\n          \"{$contestant3name}\", \n          \"{$contestant3studyplace}\", \"{$contestant3faculty}\", \"{$contestant3classcourse}\", {$contestant3age},\n          \"{$contestant3passportno}\", \"{$contestant3passportplace}\", " . $_contestant3passportdate . ",\n          " . $_contestant3birthdate . ", \"{$contestant3address}\", \"{$contestant3inn}\",\n          password(\"{$password}\"),\n          {$contestteamid},\n          \"{$language}\",\n          {$fullfilled})";
 if (@(!mysql_query($query))) {
     $error = true;
     $msg = 'Не удалось провести добавление новой команды [' . mysql_error() . ', code=' . mysql_errno() . ', sql=' . $query . ']. Попробуйте повторить попытку позже';
 } else {
     $success = true;
     $datamsg = 'Добавление новой команды проведено успешно.';
开发者ID:bearf,项目名称:xicl-web-interface,代码行数:31,代码来源:editinfo.php

示例14: getDetails

function getDetails($bigTuple, $numFlights)
{
    $fid1 = $bigTuple['FID1'];
    $departFlight = oci_fetch_assoc(executePlainSQL("select * from Flight where fid='{$fid1}'"));
    $departDate = parseDate($departFlight['DEPARTTIME'], 1);
    $departApCode = $departFlight['DEPARTAP'];
    $departAp = oci_fetch_assoc(executePlainSQL("select CITY, COUNTRY from Airport where code='{$departApCode}'"));
    $departCity = $departAp['CITY'];
    $departCountry = $departAp['COUNTRY'];
    if ($numFlights == 1) {
        $arrivalFlight = $departFlight;
    } else {
        if ($numFlights == 2) {
            $fid2 = $bigTuple['FID2'];
            $arrivalFlight = oci_fetch_assoc(executePlainSQL("select * from Flight where fid='{$fid2}'"));
        } else {
            $fid3 = $bigTuple['FID3'];
            $arrivalFlight = oci_fetch_assoc(executePlainSQL("select * from Flight where fid='{$fid3}'"));
        }
    }
    $arrivalApCode = $arrivalFlight['ARRIVALAP'];
    $arrivalAp = oci_fetch_assoc(executePlainSQL("select * from Airport where code='{$arrivalApCode}'"));
    $arrivalCity = $arrivalAp['CITY'];
    $arrivalCountry = $arrivalAp['COUNTRY'];
    $flightLoc = array("DEPARTDATE" => $departDate, "DEPARTCITY" => $departCity, "DEPARTCOUNTRY" => $departCountry, "ARRIVALCITY" => $arrivalCity, "ARRIVALCOUNTRY" => $arrivalCountry);
    return $flightLoc;
}
开发者ID:holybom,项目名称:ubcair,代码行数:27,代码来源:list_reservation.php

示例15: display_page_content


//.........这里部分代码省略.........
    $count_dashes = 0;
    if (BLOG_INSTALL) {
        ?>
	<div class="dashboard-widget column">
		<h1><?php 
        echo ucwords(BLOG_STATIC_AREA);
        ?>
 Entries</h1>
		<p>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/list_entries");
        ?>
">List Entries</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/edit_entry/add");
        ?>
">Add Entry</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/list_categories");
        ?>
">List Categories</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/add_category");
        ?>
">Add Category</a>
		</p>
		<h4>Recently Added Entries:</h4>
		<ul>
		<?php 
        $entries = MyActiveRecord::FindBySQL('Blog_Entries', "SELECT * FROM blog_entries ORDER BY date DESC LIMIT 5");
        if (!empty($entries)) {
            foreach ($entries as $entry) {
                $entrypublic = $entry->public ? "" : "<span class=\"red\">(not public)</span>";
                $entry_date = parseDate($entry->date, "m/d g:i A");
                echo "<li>\n\t\t\t\t\t\t\t<a class=\"item-link\" href=\"" . get_link("admin/edit_entry/" . $entry->id) . "\">" . $entry->get_title() . "</a>\n\t\t\t\t\t\t\t<span class=\"item-revised\">{$entry_date}</span>\n\t\t\t\t\t\t\t<span class=\"item-public\">{$entrypublic}</span>\n\t\t\t\t\t\t</li>";
            }
        }
        ?>
		</ul>
	</div>
<?php 
        $count_dashes++;
    }
    if (PORTFOLIO_INSTALL) {
        ?>
	<div class="dashboard-widget column">
		<h1>Portfolio</h1>
		<p>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_list");
        ?>
">List Items</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_add_item");
        ?>
">Add Item</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_add_section");
        ?>
">Add Section</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_add_area");
        ?>
">Add Area</a>
		</p>
		<h4>Recently Added/Edited Items:</h4>
开发者ID:highchair,项目名称:hcd-trunk,代码行数:67,代码来源:index.php


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