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


PHP Date::getTimestamp方法代码示例

本文整理汇总了PHP中Jenssegers\Date\Date::getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::getTimestamp方法的具体用法?PHP Date::getTimestamp怎么用?PHP Date::getTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jenssegers\Date\Date的用法示例。


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

示例1: imageupload

 public function imageupload(Request $request)
 {
     $file = $request->file('file');
     $d1 = new Date();
     $t1 = $d1->getTimestamp();
     $name = $t1 . ".jpg";
     $request->file('file')->move(public_path() . getenv('IMAGE_PATH'), $name);
     return response()->json(array('success' => true, 'html' => 'ok', 'url' => getenv('IMAGE_PATH') . $name));
 }
开发者ID:FreelanceDArkman,项目名称:MEA,代码行数:9,代码来源:C54_2Controller.php

示例2: array

<?php

require 'vendor/autoload.php';
use Jenssegers\Date\Date;
// Set the language
setlocale(LC_ALL, $argv[1] ?: 'en');
$months = array('january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december');
$days = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
$translations = array();
foreach ($months as $month) {
    $date = new Date($month);
    $translation = strftime('%B', $date->getTimestamp());
    $translations[$month] = $translation;
    echo "'" . $month . "'\t=> '" . $translation . "',\n";
}
echo "\n";
foreach ($days as $day) {
    $date = new Date($day);
    $translation = strftime('%A', $date->getTimestamp());
    $translations[$day] = $translation;
    echo "'" . $day . "'\t=> '" . $translation . "',\n";
}
开发者ID:arizawan,项目名称:livetvwithyoutube,代码行数:22,代码来源:generator.php

示例3: getDeletedAtTimestamp

 /**
  * @return int|null
  */
 public function getDeletedAtTimestamp()
 {
     return $this->deletedAt instanceof Date ? $this->deletedAt->getTimestamp() : null;
 }
开发者ID:simonbowen,项目名称:lumen-doctrine,代码行数:7,代码来源:SoftDeletes.php

示例4: testConstructTimestamp

 public function testConstructTimestamp()
 {
     $date = new Date(1367186296);
     $this->assertSame(1367186296, $date->getTimestamp());
 }
开发者ID:erpio,项目名称:Reportula,代码行数:5,代码来源:DateTest.php


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