I'm using:
date("d-m-Y h:i:s")
in my controller, but the time is later than actual time. For example, now in my country it's 01:02, date return 20-06-2015 01:06:38.
How to fix it?
I'm using:
date("d-m-Y h:i:s")
in my controller, but the time is later than actual time. For example, now in my country it's 01:02, date return 20-06-2015 01:06:38.
How to fix it?
1st Step :
Go to config/config.php
and write
//specify your region
date_default_timezone_set('Europe/Warsaw');
2nd step: now you can use your time
date("d-m-Y h:i:s") //for 21/12/2010 20:12:00
date("h:i:s") //for 12:12:11 time only
Your time zones are probably off, this will help you.
http://php.net/manual/en/function.date-default-timezone-set.php
Place timezone on the top of the config.php file above base_url
date_default_timezone_set('Europe/Warsaw');
Then refresh server
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Europe/Warsaw');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| If this is not set then CodeIgniter will try guess the protocol, domain
| and path to your installation. However, you should always configure this
| explicitly and never rely on auto-guessing, especially in production
| environments.
|
*/
$config['base_url'] = 'http://localhost/project/';
If you can change the hooks settings in your config file from TRUE to FALSE that should help with your issue.
Except if you have a very important need for the hooks to be enabled you should be very fine this way.
$config['enable_hooks'] = TRUE;
change to:
$config['enable_hooks'] = FALSE;
I hope this helps you.