本文整理汇总了PHP中date_timestamp_get函数的典型用法代码示例。如果您正苦于以下问题:PHP date_timestamp_get函数的具体用法?PHP date_timestamp_get怎么用?PHP date_timestamp_get使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了date_timestamp_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authenticate
public function authenticate($client = null, $code = null, $token = null)
{
if ($client === null) {
$client = $this->client;
}
if ($token !== null) {
$client->token = $token;
} else {
if (isset($code)) {
$client->token = '{"access_token":"mockupToken","token_type":"Bearer","expires_in":3600,"id_token":"mockupIdToken","refresh_token":"mockupRefreshToken","created":' . date_timestamp_get(date_create()) . '}';
$token = isset($client->token) ? $client->token : null;
}
}
$this->accessToken = $token;
if (isset($token) && $token) {
if (isset($client->expiredToken) && $client->expiredToken) {
$client->token = '{"access_token":"mockupToken","token_type":"Bearer","expires_in":3600,"id_token":"mockupIdToken","refresh_token":"mockupRefreshToken","created":' . date_timestamp_get(date_create()) . '}';
unset($client->expiredToken);
$this->accessToken = $client->token;
}
return array('access_token' => $this->accessToken);
} else {
return array('authUrl' => 'http://mockupauth.url');
}
}
示例2: __construct
function __construct()
{
$this->user_data = array(BIRTHDAY => date_timestamp_get(date_create("1985-03-20")), BIRTHPLACE => "QUI!", EMAIL => "no-reply2@ioesisto.com", GENDER => "m", HOBBIES => "porno, siti, soldi", JOB => "nessuno", LIVING_PLACE => "Lì!", NAME => "IO", NICKNAME => "iotransisto", PASSWORD => sha1("cazzi miei!" . sha1("cazzi miei!")), ROLE => "admin", SURNAME => "ESISTO", VISIBLE => true);
$this->user_data2 = array(BIRTHDAY => date_timestamp_get(date_create("1985-03-20")), BIRTHPLACE => "Lì!", EMAIL => "ma_sti_cazzi@ioesisto.com", GENDER => "f", HOBBIES => "porno, porno, porno", JOB => "prostituto", LIVING_PLACE => "Là!", NAME => "TU", NICKNAME => "iocoesisto", PASSWORD => sha1("ma fatti i cazzi tuoi" . sha1("ma fatti i cazzi tuoi")), ROLE => "admin", SURNAME => "COESISTI?", VISIBLE => false);
$this->contact_data = array(NAME => "cellulare", CONTACT => "340xxxxxxx", TYPE => PHONE);
$this->contact_data2 = array(NAME => "email", CONTACT => "iosussisto@ioesisto.com", TYPE => EMAIL);
}
示例3: remove
public function remove($id)
{
$fav = Favorite::where('StudentID', Auth::user()->StudentID)->where('FavoriteID', $id)->where('favorite', '1')->first();
$fav->favorite = 0;
$fav->updated_at = date_timestamp_get(date_create());
$fav->save();
}
示例4: timeConvert
function timeConvert($mysqlTime)
{
date_default_timezone_set('Europe/Helsinki');
$date = date_create($mysqlTime);
$timestamp = date_timestamp_get($date);
echo $timestamp;
}
示例5: __construct
/**
* Constructor
*
* @param scalar|array|PayloadInterface $payload
* @param string $id
* @param int $timestamp
* @param float $version
* @throws
*/
public function __construct($payload = null, $id = null, $timestamp = null, $version = 1.0)
{
if (!is_null($payload)) {
if ($payload instanceof PayloadInterface) {
$this->payload = $payload->getArrayCopy();
} else {
if (is_array($payload) || is_scalar($payload)) {
$this->payload = $payload;
} else {
throw MessageException::payloadTypeError('Payload must be a scalar value, an array or an instance of PayloadInterface');
}
}
}
if (is_null($id)) {
$this->id = uniqid();
} else {
$this->id = $id;
}
if (is_null($timestamp)) {
$this->timestamp = date_timestamp_get(date_create());
} else {
$this->timestamp = $timestamp;
}
$this->version = $version;
}
示例6: store
public static function store()
{
self::check_logged_in(array("asiakas", "tyontekija", "johtaja"));
$params = $_POST;
$palvelu = Palvelu::find($params['palvelu_id']);
$aloitusaika = strtotime($params['paiva'] . ' ' . $params['kellonaika']);
list($tunnit, $minuutit, $sekunnit) = sscanf($palvelu->kesto, '%d:%d:%d');
$kesto = new DateInterval(sprintf('PT%dH%dM', $tunnit, $minuutit));
$lopetusaika = date_timestamp_get(date_add(new DateTime('@' . $aloitusaika), $kesto));
$attributes = array('asiakas_id' => $params['asiakas_id'], 'palvelu_id' => $params['palvelu_id'], 'tyontekija_id' => $params['tyontekija_id'], 'toimitila_id' => $params['toimitila_id'], 'aloitusaika' => date('Y-m-d H:i', $aloitusaika), 'lopetusaika' => date('Y-m-d H:i', $lopetusaika), 'on_peruutettu' => NULL);
$varaus = new Varaus($attributes);
$errors = $varaus->errors();
// tarkistetaan resurssien ja asiakkaan saatavuus varausajalle
if (count($errors) == 0) {
$errors = $varaus->check_overlaps();
}
if (count($errors) > 0) {
$tyontekijat = Tyontekija::all();
$palvelut = Palvelu::all();
$toimitilat = Toimitila::all();
$asiakkaat = Asiakas::all();
View::make('varaus/varaus_lisaa.html', array('errors' => $errors, 'varaus' => $varaus, 'tyontekijat' => $tyontekijat, 'palvelut' => $palvelut, 'toimitilat' => $toimitilat, 'asiakkaat' => $asiakkaat));
} else {
$varaus->save();
Redirect::to('/', array('message' => 'Varaus tallennettu.'));
}
}
示例7: draw_date
function draw_date($date, $text_center)
{
$date_string = date($this->month_year, date_timestamp_get($date));
$box = imagettfbbox($this->font_size, 0, $this->font, $date_string);
$text_width = abs($box[4] - $box[0]);
$text_height = abs($box[5] - $box[1]);
$text_start = $text_center - $text_width / 2;
imagettftext($this->im, $this->font_size, 0, $text_start, $this->bottom_line_y + $text_height + $this->tick_height + $this->text_top_padding, $this->textcolor, $this->font, $date_string);
}
示例8: valid_birthday
function valid_birthday($birthday)
{
$date = date_create();
$birthdate = date_create($birthday);
if (date_timestamp_get($date) <= date_timestamp_get($birthdate)) {
return 0;
} else {
return 1;
}
}
示例9: serialize
/**
* Serializes the current state.
*
* @param CurrentState $state The current state.
* @param IOutputStream $outputStream The output stream.
*
* @return none
*/
public function serialize($state, $outputStream)
{
$statusLeaseInfo = array('StatusLease' => array('@attributes' => array('ClientId' => $state->getClientId())));
if ($state instanceof AcquireCurrentState) {
$statusLeaseInfo['StatusLease']['Acquire'] = array('Incarnation' => $state->getIncarnation(), 'Status' => $state->getStatus(), 'Expiration' => Utilities::isoDate(date_timestamp_get($state->getExpiration())));
} elseif ($state instanceof ReleaseCurrentState) {
$statusLeaseInfo['StatusLease']['Release'] = array();
}
$currentState = Utilities::serialize($statusLeaseInfo, 'CurrentState');
fwrite($outputStream, $currentState);
}
示例10: save
public function save($id)
{
$in = Input::all();
$post = Post::find($id);
if (Auth::user()->StudentID == $post->StudentID) {
$post->message = $in['message'];
$post->edited = 1;
$post->updated_at = date_timestamp_get(date_create());
$post->save();
}
}
示例11: formatTimeago
public function formatTimeago($value)
{
if ($value instanceof DateTime) {
$value = date_timestamp_get($value);
} else {
if (is_string($value)) {
$value = strtotime($value);
}
}
return $this->inWords(time() - $value);
}
示例12: call
public function call()
{
$app = $this->app;
$route = $app->request()->getPathInfo();
if (strpos($route, '/api/') !== false) {
$res = $app->response();
$app->response()->headers->set('Content-Type', 'application/json');
$res->headers->set('X-Api-Version', $this->config['astro']['version']);
$res->headers->set('X-Timestamp', date_timestamp_get(date_create()));
}
$this->next->call();
}
示例13: formatTimeago
public function formatTimeago($value)
{
if ($value instanceof DateTime) {
$value = date_timestamp_get($value);
} else {
if (is_string($value)) {
$value = strtotime($value);
}
}
$time = time() - Yii::app()->session['TimeOffSet'];
return $this->inWords($time - $value);
}
示例14: createToken
function createToken($ip, $id)
{
//store id in session
session_start();
$_SESSION['user_id'] = $id;
//convert ip address to base 13
$cIp = base_convert($ip, 10, 13);
//convert timestamp to base 25
$date = date_create();
$cTime = base_convert(date_timestamp_get($date), 10, 25);
//convert id to base 11
$cId = base_convert($id, 10, 11);
$ipLen = strlen($cIp);
$timeLen = strlen($cTime);
$idLen = strlen($cId);
//normalize lengths
$add = 12 - $ipLen;
$os = "";
for ($i = 0; $i < $add; $i++) {
$os .= "0";
}
$os .= $cIp;
$cIp = $os;
$add = 12 - $timeLen;
$os2 = "";
for ($i = 0; $i < $add; $i++) {
$os2 .= "0";
}
$os2 .= $cTime;
$cTime = $os2;
$add = 12 - $idLen;
$os3 = "";
for ($i = 0; $i < $add; $i++) {
$os3 .= "0";
}
$os3 .= $cId;
$cId = $os3;
//token prior to zipping
$preZip .= "{$cIp}";
$preZip .= "{$cId}";
$preZip .= "{$cTime}";
global $zKey;
//zip pieces
foreach ($zKey as $val) {
$token .= substr($preZip, $val, 1);
}
//hash token and append to end
$hash = sha1($token);
$token .= $hash;
return $token;
}
示例15: applyDateTimeFormat
/**
* @access private
*
* @param mixed $value
* @return mixed
*/
private function applyDateTimeFormat($value)
{
$datetime_format = $this->format['datetime'];
if (empty($datetime_format['format'])) {
return $value;
} else {
$datetime = date_create($value);
if ($datetime) {
return strftime($datetime_format['format'], date_timestamp_get($datetime));
} else {
return $value;
}
}
}