date() today 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)// returned $date Y/m/d
function work_days_from_date($days, $forward, $date=NULL)
{
if(!$date)
{
$date = date('Y-m-d'); // if no date given, use todays date
}
while ($days != 0)
{
$forward == 1 ? $day = strtotime($date.' +1 day') : $day = strtotime($date.' -1 day');
$date = date('Y-m-d',$day);
if( date('N', strtotime($date)) <= 5) // if it's a weekday
{
$days--;
}
}
return $date;
}
Also in PHP:
- calculate person age by birthdate php
- datetime manual date format
- add floater to open a modal in wordpress
- cache laravel example
- adjacent post sort order by post title
- codeigniter insert get id
- PHP Startup: Unable to load dynamic library 'curl'
- Illuminate\Contracts\Container\BindingResolutionException Target class [SlugController] does not exist.
- count length string php
- confirm password validation in laravel
- check if array is duplicate and get the latest values php
- datetime format
- Impossible de trouver le paquet php-gettext
- How to check beautify json result using php
- days to date php
- create new larael project 7
- base64 php decode with password
- db seed specific seeder
- date formatting php
- How to calculate the difference between two dates
- errorLevel php no warnings
- convert uppercase to capitalize in php
- associative array in one key in value must unique in array check in php
- check type of object in php