date and time function in php
$today = date("F j, Y, g:i a"); // October 30, 2019, 10:42 pm
$today = date("D M j G:i:s T Y"); // Wed Oct 30 22:42:18 UTC 2019
$today = date("Y-m-d H:i:s"); // 2019-10-30 22:42:18(MySQL DATETIME format)$dateTime = new \DateTime();
/**
* You can get the string by using format
*/
$dateTime->format('Y-m-d H:i:s');/**
* Its always best to use a datetime object
*/
$dateTime = new \DateTime();
/**
* You can get the string by using format
*/
$dateTime->format('Y-m-d H:i:s');
Also in PHP:
- calculate person age by birthdate php
- buddy group hide notice join
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767
- check if character in string php
- create laravel 5.8 project using composer
- add one day to given date in php
- custom post type with taxonomy
- check type of object in php
- array_reverse in php
- delete cache on host laravel
- cache clear in laravel command
- exit and echo php
- e error reporting all
- determine length of stirng php
- age date de naissance php
- defaultstringlength(191)
- FORMATA DATA COM PHP
- display errors on
- adjacent post sort order by post title
- console log with php on form sent
- check my version of composer
- encontrar una palabra dentro de una cadena php
- check if word exist in string
- dateofrmat php