本文整理汇总了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";
示例2:
<?php
require_once "../general.php";
$t = Time::dateToUnix('12/07/1986');
echo $t . "\n";
echo Time::unixToDate(1350988194976 / 1000);
示例3: getBirthday
public function getBirthday()
{
return Time::unixToDate($this->_orm->birthday);
}
示例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);
}
};
}
示例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');
?>