• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP parseDate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: mysql_query

        mysql_query($query) or die(mysql_error());
        $r_id = mysql_insert_id();
        header("Location:index.php?inc=manage_releases");
    }
}
if ($action == "update" && $r_id != "") {
    if (!isValidDate($r_date)) {
        $tmp = $lng[14][13];
    }
    if ($r_released_date != "" && !isValidDate($r_released_date)) {
        $tmp = $lng[14][14];
    }
    if ($tmp == "") {
        $r_date = parseDate($r_date, "%d.%m.%Y");
        //parsing date into mysql format
        $r_released_date = parseDate($r_released_date, "%d.%m.%Y");
        //parsing date into mysql format
        $query = "update releases set r_name='" . escapeChars($r_name) . "', r_date='" . escapeChars($r_date) . "', r_released_date='" . escapeChars($r_released_date) . "', r_global='" . escapeChars($r_global) . "' where r_id=" . $r_id;
        mysql_query($query) or die(mysql_error());
        header("Location:index.php?inc=manage_releases");
    }
}
if ($r_id != "") {
    $query = "select *, date_format(r_date, '%d.%m.%Y') as d1, date_format(r_released_date, '%d.%m.%Y') as d2 from releases where r_id=" . $r_id;
    $rs = mysql_query($query) or die(mysql_error());
    if ($row = mysql_fetch_array($rs)) {
        $r_name = htmlspecialchars($row['r_name']);
        $r_date = $row['d1'];
        $r_released_date = $row['d2'];
        $r_global = $row['r_global'];
    }
开发者ID:teungri,项目名称:RequirementsApp,代码行数:31,代码来源:edit_release.php


示例17: initialize_page

function initialize_page()
{
    $event_types = EventTypes::FindAll();
    $event_periods = EventPeriods::FindAll();
    $post_action = "";
    if (isset($_POST['submit'])) {
        $post_action = $_POST['submit'];
        if ($post_action == "Add Event and add another" || $post_action == "Add and Return to List") {
            $event = MyActiveRecord::Create('Events', $_POST);
            if (!getPostValue('time_start')) {
                $event->setDateStart(getPostValue('date_start'), "04:00:00");
            } else {
                $event->time_start = date("H:i:s", strtotime(getPostValue('time_start')));
            }
            if (!getPostValue('date_end') && !getPostValue('time_end')) {
                $event->setDateEnd(getPostValue('date_start'), "04:00:00");
            } else {
                if (!getPostValue('date_end') && getPostValue('time_end')) {
                    $event->setDateEnd(getPostValue('date_start'), date("H:i:s", strtotime(getPostValue('time_end'))));
                } else {
                    $event->setDateEnd(getPostValue('date_end'), date("H:i:s", strtotime(getPostValue('time_end'))));
                }
            }
            $event->eventtype_id = isset($_POST['eventtype_id']) ? $_POST['eventtype_id'] : 1;
            $event->eventperiod_id = $_POST['eventperiod_id'];
            $event->save();
            $notdates = getPostValue('notdates');
            if (is_array($notdates)) {
                foreach ($notdates as $date) {
                    if (strlen($date) > 4) {
                        $query = "INSERT INTO events_notdate VALUES('{$event->id}','" . formatDateView($date, "Y-m-d") . "')";
                        mysql_query($query, MyActiveRecord::Connection()) or die($query);
                    }
                }
            }
            add_eventUpdateRecurrences($event);
            $thisnewevent = Events::FindById($event->id);
            if ($thisnewevent->date_end < $thisnewevent->date_start) {
                setFlash("<h3>Whoops! Event Starts after it Ends! Please correct dates...</h3>");
                $eventyear = parseDate($thisnewevent->date_start, "Y");
                $eventmonth = parseDate($thisnewevent->date_start, "n");
                redirect("/admin/edit_event/{$eventyear}/{$eventmonth}/{$thisnewevent->id}");
            } else {
                setFlash("<h3>Event added</h3>");
                if ($post_action == "Add and Return to List") {
                    // Redirect user to the Main Event List
                    $datestart = explode("/", getPostValue('date_start'));
                    setFlash("<h3>Event added</h3>");
                    redirect("/admin/list_events/{$datestart['2']}/{$datestart['0']}");
                }
            }
        }
    }
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:54,代码来源:add_event.php


示例18: parseDate

}
// Fixed args
$csdl_filename = $env->args[0];
$start_date = $env->args[1];
$end_date = $env->args[2];
$sources = $env->args[3];
$sample = $env->args[4];
$name = $env->args[5];
$output_type = $env->args[6];
// The rest of the args will be output parameters, and we'll use them later
// Parse the dates from the command line
$start_date = parseDate($start_date);
if (!$start_date) {
    usage('Invalid start date!');
}
$end_date = parseDate($end_date);
if (!$end_date) {
    usage('Invalid end date!');
}
// Load the CSDL
$csdl = false;
if (file_exists($csdl_filename)) {
    $csdl = file_get_contents($csdl_filename);
}
if (!$csdl) {
    usage('Failed to read CSDL from ' . $csdl_filename);
}
// Create the stream definition
$stream_definition = $env->user->createDefinition($csdl);
try {
    $historic = $stream_definition->createHistoric($start_date, $end_date, explode(',', $sources), $sample);
开发者ID:datasift,项目名称:datasift-php,代码行数:31,代码来源:push_historic_from_csdl.php


示例19: parseDate

function parseDate($str)
{
    if (preg_match('/^(\\d{4})년 (\\d{2})월 (\\d{2})일  (\\d{2}):(\\d{2}):(\\d{2})$/', $str, $matches)) {
        return parseDate("{$matches[1]}-{$matches[2]}-{$matches[3]} {$matches[4]}:{$matches[5]}:{$matches[6]}");
    }
    if (preg_match('/^(\\d{2})-(\\d{2})-(\\d{4}) (\\d{2}):(\\d{2})$/', $str, $matches)) {
        return parseDate("{$matches[3]}-{$matches[1]}-{$matches[2]} {$matches[4]}:{$matches[5]}:00}");
    }
    if (empty($str)) {
        return 0;
    }
    $time = strtotime($str);
    if ($time !== -1) {
        return $time;
    }
    $gmt = substr($str, strpos($str, "GMT")) == "GMT" ? 9 : 0;
    $str = str_replace("년 ", "-", $str);
    $str = str_replace("월 ", "-", $str);
    $str = str_replace("일 ", "", $str);
    $str = str_replace("GMT", "", $str);
    $str = str_replace("KST", "+0900", $str);
    if (strpos($str, "T")) {
        list($date, $time) = explode("T", $str);
        list($y, $m, $d) = explode("-", $date);
        list($time) = explode("+", $time);
        @(list($h, $i, $s) = explode(":", $time));
    } else {
        if (strpos($str, ":") && strpos($str, "-")) {
            list($str) = explode(".", $str);
            list($date, $time) = explode(" ", $str);
            list($y, $m, $d) = explode("-", $date);
            if ($d > 1900) {
                $t = $y;
                $y = $d;
                $d = $m;
                $m = $t;
            }
            @(list($h, $i, $s) = explode(":", $time));
        } else {
            if (strpos($str, ",") && strpos($str, ":")) {
                list($temp, $str) = explode(",", $str);
                $str = trim(str_month_check($str));
                list($d, $m, $y, $time) = explode(" ", $str);
                list($h, $i, $s) = explode(":", $time);
            } else {
                return gmmktime();
            }
        }
    }
    if (!$h) {
        $h = "00";
    }
    if (!$i) {
        $i = "00";
    }
    if (!$s) {
        $s = "00";
    }
    $h += $gmt;
    return mktime($h, $i, $s, $m, $d, $y);
}
开发者ID:Avantians,项目名称:Textcube,代码行数:61,代码来源:reader.php


示例20: getDefaultCenterPanel


//.........这里部分代码省略.........
														<td class="title"><a href="<?php 
            echo $item['link'];
            ?>
"><?php 
            echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20));
            ?>
</a></td>
													</tr>
<?php 
        }
        ?>
												</tbody>
											</table>
										</div>

<?php 
        $noticeURL = TEXTCUBE_NOTICE_URL;
        $noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss";
        $noticeEntries = array();
        if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) {
            $noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')));
        } else {
            list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS);
            if ($result == 0) {
                $xmls = new XMLStruct();
                $xmls->setXPathBaseIndex(1);
                $noticeEntries = array();
                if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) {
                    if ($xmls->getAttribute('/rss', 'version')) {
                        for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) {
                            $item = array('permalink' => rawurldecode($link));
                            $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title");
                            if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) {
                                $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate"));
                            } else {
                                if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) {
                                    $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date"));
                                } else {
                                    $item['written'] = 0;
                                }
                            }
                            array_push($noticeEntries, $item);
                        }
                    }
                }
                Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries));
            }
        }
        ?>
										<div id="textcube-notice">
											<h4 class="caption"><span><a href="<?php 
        echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko");
        ?>
"><?php 
        echo _t('공지사항');
        ?>
</a></span></h4>
<?php 
        if (count($noticeEntries) > 0) {
            array_splice($noticeEntries, 3, count($noticeEntries) - 3);
            ?>
											<table>
												<tbody>
<?php 
            foreach ($noticeEntries as $item) {
                ?>
开发者ID:webhacking,项目名称:Textcube,代码行数:67,代码来源:index.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP parseDateTime函数代码示例发布时间:2022-05-15
下一篇:
PHP parseChangelogLine函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap