1<?php
2 // First day of this month
3 $d = new DateTime('first day of this month');
4 echo $d->format('jS, F Y');
5?>
1//get first day of the current month
2$start = date("Y-m-1 00:00:00");
3//get current date of the month
4$end = date("Y-m-d H:i:s");
5
6//query data for the current month so far
7$query = $this->db_model->run_query("select column_1, column_2 from table where date_column BETWEEN '".$start."' AND '".$end."'");
1$config_month = 1;
2$config_day = 1;
3
4$new_expiry_date = date('Y-m-d', mktime(0, 0, 0, date('m') + $config_month, 1 + $config_day, date('Y')));
5