本文整理汇总了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));
}
示例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";
}
示例3: getDeletedAtTimestamp
/**
* @return int|null
*/
public function getDeletedAtTimestamp()
{
return $this->deletedAt instanceof Date ? $this->deletedAt->getTimestamp() : null;
}
示例4: testConstructTimestamp
public function testConstructTimestamp()
{
$date = new Date(1367186296);
$this->assertSame(1367186296, $date->getTimestamp());
}