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

PREVIOUS NEXT
Code Example
Php :: Searching the array for multiple values 
Php :: grouping routes in laravel 
Php :: how to create compomemt in laravel livewire 
Php :: php remove warning 
Php :: wordpress get user id by email 
Php :: remove cookies php 
Php :: Add 2 hours to current time in cakephp 
Php :: set image asset path in laravel 
Php :: laravel migration change column length 
Php :: basic code for file upload in php 
Php :: include and require in php 
Php :: laravel timestamps on pivot table 
Php :: composer clear cache 
Php :: running a laravel app locally 
Php :: laravel migration change default value 
Php :: laravel validate unique column 
Php :: check if date is past php 
Php :: while loop php 
Php :: php intl 
Php :: ucfirst meaning in php 
Php :: php set alternatives 
Php :: display image in laravel 
Php :: route params link laravel 
Php :: server error in laravel 
Php :: how login with phone in laravel 
Php :: php array_values 
Php :: palindrome in php 
Php :: acf options repeater 
Php :: php get current date strtotime 
Php :: db::statement in laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =