當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Time::unixToDate方法代碼示例

本文整理匯總了PHP中Time::unixToDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Time::unixToDate方法的具體用法?PHP Time::unixToDate怎麽用?PHP Time::unixToDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Time的用法示例。


在下文中一共展示了Time::unixToDate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: print_r

<?php

require_once '../general.php';
$stocks = Stock::all()->as_array();
print_r($stocks);
echo time() . "\n";
echo Time::unixToDate(time()) . "\n";
echo date(DATE_RFC822, strtotime('thursday next week 10:30am', 1352710199)) . "\n";
echo date(DATE_RFC822, strtotime('next month', 1352710199)) . "\n";
開發者ID:samdubey,項目名稱:ads2,代碼行數:9,代碼來源:stock_test.php

示例2:

<?php

require_once "../general.php";
$t = Time::dateToUnix('12/07/1986');
echo $t . "\n";
echo Time::unixToDate(1350988194976 / 1000);
開發者ID:samdubey,項目名稱:ads2,代碼行數:6,代碼來源:time_test.php

示例3: getBirthday

 public function getBirthday()
 {
     return Time::unixToDate($this->_orm->birthday);
 }
開發者ID:samdubey,項目名稱:ads2,代碼行數:4,代碼來源:profile.php

示例4: user_order_receipt

 public static function user_order_receipt()
 {
     return function ($request, $response) {
         $user_id = $request->session('id');
         if ($user_id) {
             $response->header('Content-Type', 'application/pdf');
             $id = $request->id;
             $order = Order::findById($id);
             $report = Zend_Pdf::load('../pdf/trustrec.pdf');
             $page = $report->pages[0];
             $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES);
             $page->setFont($font, 11);
             $page->drawText(Time::unixToDate(time()), 460, 900);
             $page->drawText(Time::unixToDate(time()), 460, 455);
             $page->drawText('Order#: ' . $order->id, 400, 910);
             $page->drawText('Order#: ' . $order->id, 400, 465);
             $page->drawText($order->user->profile->fullname, 100, 900);
             $page->drawText($order->user->profile->fullname, 100, 455);
             $page->drawText($order->user->profile->address, 440, 530);
             $page->drawText($order->user->profile->address, 440, 85);
             $page->drawText($order->user->profile->fullname, 445, 555);
             $page->drawText($order->user->profile->fullname, 445, 109);
             $row = 850;
             foreach ($order->items as $item) {
                 # code...
                 $page->drawText($item->product->name, 80, $row);
                 $page->drawText($item->product->name, 80, $row - 446);
                 $page->drawText($item->quantity, 45, $row);
                 $page->drawText($item->quantity, 45, $row - 446);
                 $page->drawText(money_format('%5.2n', $item->product->price), 315, $row);
                 $page->drawText(money_format('Php %5.2n', $item->subtotal), 370, $row);
                 $page->drawText(money_format('%5.2n', $item->product->price), 315, $row - 446);
                 $page->drawText(money_format('Php %5.2n', $item->subtotal), 370, $row - 446);
                 $row -= 17;
             }
             $page->drawText(money_format('Php %5.2n', $order->total), 370, 562);
             $page->drawText(money_format('Php %5.2n', $order->total), 370, 118);
             #$page->drawText( money_format('Php %5.2n', $order->total * 0.30),450,485);
             echo $report->render();
         } else {
             $response->code(403);
         }
     };
 }
開發者ID:samdubey,項目名稱:ads2,代碼行數:44,代碼來源:reportctrl.php

示例5: dirname

<?php

require_once "../db/general.php";
$path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'lib';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once "Zend/Pdf.php";
//$response->header('Content-Type','application/pdf');
$stocks_report = Zend_Pdf::load('../pdf/inv.pdf');
$page = $stocks_report->pages[0];
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES);
$page->setFont($font, 11);
//echo "Height = {$page->getHeight()} \n";
//echo "Width  = {$page->getWidth()} \n";
$page->drawText("as of " . Time::unixToDate(time()), 100, 100);
echo $stocks_report->save('test.pdf');
?>

開發者ID:samdubey,項目名稱:ads2,代碼行數:16,代碼來源:pdf.php


注:本文中的Time::unixToDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。