timezone change

This commit is contained in:
gandhimathi 2017-12-01 11:11:55 +05:30
parent 6ae6af39e8
commit 547119db54

View File

@ -31,12 +31,15 @@ class Batch_Controller extends REST_Controller {
public function addBatchDetails_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$details['BatchCode'] = $this->post('batchcode');
$details['BatchName'] = $this->post('batcheName');
$details['UniversityID'] = $this->post('universityName');
$details['CreatedBy'] = $this->post('createdBy');
$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)
if ($batchDetails)
{
@ -86,11 +89,16 @@ class Batch_Controller extends REST_Controller {
* */
public function updateBatchDetails_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$details['BatchCode'] = $this->post('batchCode');
$details['BatchName'] = $this->post('batchName');
$details['IsActive'] = $this->post('status');
$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)
if ($updateDetails)
@ -112,4 +120,4 @@ class Batch_Controller extends REST_Controller {
}
}
}