date formate with pc time 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)//Get current date time in PHP
// Simply:
$date = date('Y-m-d H:i:s');
// Or:
$date = date('Y/m/d H:i:s');
// This would return the date in the following formats respectively:
$date = '2012-03-06 17:33:07';
// Or
$date = '2012/03/06 17:33:07';
/**
* This time is based on the default server time zone.
* If you want the date in a different time zone,
* say if you come from Nairobi, Kenya like I do, you can set
* the time zone to Nairobi as shown below.
*/
date_default_timezone_set('Africa/Nairobi');
// Then call the date functions
$date = date('Y-m-d H:i:s');
// Or
$date = date('Y/m/d H:i:s');
// date_default_timezone_set() function is however
// supported by PHP version 5.1.0 or above.
Also in PHP:
- current date into time
- date format ph
- add one day to date in php
- date.now() php
- check if array has key php
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in \xampp\htdocs\
- array filter remove duplicates multidimensional php
- blog post page is_home
- create DateTime from timestamp php
- $this- attribute laravel
- extract($user_input); alternative php
- can you have more than one constructor in class php
- error reporting all php
- check if $this-> key exist php
- Composer detected issues in your platform: Your Composer dependencies require a PHP version but php is higher
- dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib Referenced from: /usr/local/bin/php Reason: image not found zsh: abort bin/console sw:cache:clear
- 500 (internal server error) laravel
- check if key exist in php
- THROW EXPECTION PHP
- clean cache laravel
- check if home page woocmerce
- "Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52"
- basic code for file upload in php
- code in try in php shows error output