timezone change
This commit is contained in:
parent
6ae6af39e8
commit
547119db54
@ -31,12 +31,15 @@ class Batch_Controller extends REST_Controller {
|
|||||||
|
|
||||||
public function addBatchDetails_post()
|
public function addBatchDetails_post()
|
||||||
{
|
{
|
||||||
|
$now = new DateTime();
|
||||||
|
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
||||||
$details['BatchCode'] = $this->post('batchcode');
|
$details['BatchCode'] = $this->post('batchcode');
|
||||||
$details['BatchName'] = $this->post('batcheName');
|
$details['BatchName'] = $this->post('batcheName');
|
||||||
$details['UniversityID'] = $this->post('universityName');
|
$details['UniversityID'] = $this->post('universityName');
|
||||||
$details['CreatedBy'] = $this->post('createdBy');
|
$details['CreatedBy'] = $this->post('createdBy');
|
||||||
$details['IsActive'] = $this->post('status');
|
$details['IsActive'] = $this->post('status');
|
||||||
|
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
$batchDetails = $this->batch_model->addBatch($details);// Check if the users data store contains users (in case the database result returns NULL)
|
$batchDetails = $this->batch_model->addBatch($details);// Check if the users data store contains users (in case the database result returns NULL)
|
||||||
if ($batchDetails)
|
if ($batchDetails)
|
||||||
{
|
{
|
||||||
@ -86,11 +89,16 @@ class Batch_Controller extends REST_Controller {
|
|||||||
* */
|
* */
|
||||||
public function updateBatchDetails_post()
|
public function updateBatchDetails_post()
|
||||||
{
|
{
|
||||||
|
$now = new DateTime();
|
||||||
|
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
||||||
$details['BatchCode'] = $this->post('batchCode');
|
$details['BatchCode'] = $this->post('batchCode');
|
||||||
$details['BatchName'] = $this->post('batchName');
|
$details['BatchName'] = $this->post('batchName');
|
||||||
$details['IsActive'] = $this->post('status');
|
$details['IsActive'] = $this->post('status');
|
||||||
$details['UpdatedBy'] = $this->post('updatedBy');
|
$details['UpdatedBy'] = $this->post('updatedBy');
|
||||||
$details['UpdatedOn'] = date("Y-m-d", time());
|
$details['UpdatedOn'] = $now->format("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
// print_r( $details['UpdatedOn'])
|
||||||
|
//exit();
|
||||||
$updateDetails = $this->batch_model->updateBatch($details);// Check if the users data store contains users (in case the database result returns NULL)
|
$updateDetails = $this->batch_model->updateBatch($details);// Check if the users data store contains users (in case the database result returns NULL)
|
||||||
|
|
||||||
if ($updateDetails)
|
if ($updateDetails)
|
||||||
@ -112,4 +120,4 @@ class Batch_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user