Search
 
SCRIPT & CODE EXAMPLE
 

PHP

unix timestamp in php

strtotime("now");

// strtotime is a function that will take a string parameter 
// that specifies a date, and returns a unix time stamp bassed
// on that

echo strtotime("2020-02-24");

// prints: 1582502400
Comment

Getting Current Timestamp in PHP

<?php
$current_timestamp = time();
echo $current_timestamp;
?>
Comment

php timestamp

<?php

echo time();

?>
Comment

php timestamp


<?php
$nextWeek = time() + (7 * 24 * 60 * 60);
                   // 7 days; 24 hours; 60 mins; 60 secs
echo 'Now:       '. date('Y-m-d') ."
";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."
";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."
";
?>

Comment

timestamp php


<?php
$date = date_create();
echo date_timestamp_get($date);
?>

Comment

how to get the current timestamp in php

echo $difference_in_seconds = strtotime('2016-11-30 11:55:06') - strtotime('2016-11-30 03:55:06');//28800
Comment

how to get the current timestamp in php

%Y - use for difference in year
%m - use for difference in months
%d - use for difference in days
%H - use for difference in hours
%i - use for difference in minutes
%s - use for difference in seconds
Comment

PREVIOUS NEXT
Code Example
Php :: increase the number in php by a certain percentage 
Php :: sum multiple fields separately in laravel 
Php :: run php server mac 
Php :: how to debug php 
Php :: redirect php 
Php :: find string in text in laravel 
Php :: file original extensions laravel 
Php :: collection pluck remove duplicates 
Php :: twig print_r 
Php :: laravel singular 
Php :: add to url anchor tag laravel with variable 
Php :: wordpress convert non negative 
Php :: link js file in php 
Php :: php var dump die 
Php :: how to mantain text in form after error php 
Php :: laravel faker car plate br mercossul 
Php :: convert multidimensional array into single dimension php 
Php :: laravel go back to previous page blade 
Php :: wordpress wpdb insert debug 
Php :: subtract some days php 
Php :: check if a string is url or not php 
Php :: fecade Artisan:call laravel 
Php :: php remove query param from url 
Php :: string length php 
Php :: foreach skip first php 
Php :: get image name and extension laravel 
Php :: contact form 7 select disabled option 
Php :: symfony convert entity to array 
Php :: laravel login by id 
Php :: laravel get authorization bearer token 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =