$first_day = date('Y-m-01'); $last_day = date('Y-m-t');
<?php
// First day of this month
$d = new DateTime('first day of this month');
echo $d->format('jS, F Y');
?>
//get first day of the current month
$start = date("Y-m-1 00:00:00");
//get current date of the month
$end = date("Y-m-d H:i:s");
//query data for the current month so far
$query = $this->db_model->run_query("select column_1, column_2 from table where date_column BETWEEN '".$start."' AND '".$end."'");
$first = date('Y-m-01', strtotime('last month'));
$last = date('Y-m-t', strtotime('last month'));
$config_month = 1;
$config_day = 1;
$new_expiry_date = date('Y-m-d', mktime(0, 0, 0, date('m') + $config_month, 1 + $config_day, date('Y')));
$firstOfMonth = date('Y-m-01');
Code Example |
---|
Php :: switch case php |
Php :: php yesterday date |
Php :: twig jsoncencode |
Php :: pretty show php arrays |
Php :: php echo alert js |
Php :: strtolower php |
Php :: get env app url laravel |
Php :: 419 unknown status |
Php :: change background color php |
Php :: total no of occurances in string php |
Php :: pdo connexion |
Php :: geoip php sample |
Php :: switch between php version ubuntu nginx |
Php :: set subject for mail inlaravel |
Php :: add zeros in front of number php |
Php :: laravel model insert |
Php :: laravel database connection check |
Php :: php grab year from date |
Php :: magento2 memory limit |
Php :: wordpress logout redirect to home |
Php :: seed date laravel |
Php :: reindex array php |
Php :: phpstan ignore |
Php :: get last slash value in php |
Php :: wordpress check shortcode exists |
Php :: how to switch from php7.4 to php7.3 mac |
Php :: laravel now date |
Php :: get the value of href in anchar tag php |
Php :: CGST/SGST calculate in laravel 8 |
Php :: laravel redirect to previous page |