date time to timestamp php
<?php
echo date('m/d/Y H:i:s', 1541843467);
?> $s = '06/10/2011 19:00:02';
$date = strtotime($s);
echo date('d/M/Y H:i:s', $date);
The above one is the one of the example of converting a string to date.
echo $s ->format('Y-m-d');
The above one is another method $date = new DateTime();
echo $date->getTimestamp();<?php
$date = new DateTime();
echo $date->format('U = Y-m-d H:i:s') . "\n";
$date->setTimestamp(1171502725);
echo $date->format('U = Y-m-d H:i:s') . "\n";
?>
Also in PHP:
- display picture in pdf generated with laravel
- array unicode php
- date format php date format)
- array_uniqe php
- check composer version in cmd
- check isset key in array php
- Adding string with number in php
- add day to php date
- array shift php
- check if array element is set php
- .lenght en php string
- create php laravel project
- Which are valid PHP error handling keywords? try throw catch finally
- catch erro message php
- create new laravel project terminal
- base 64 decode in php
- check if sting contains word php
- clear route cache laravel
- PHP foreach loop backwards
- array merge in php
- Codeigniter count query results
- check if array has a certain key
- $mpdf
- date( w ) php