Welcome Guest, Not a member yet? Register   Sign In
data helper and mysql date/time functions
#1

[eluser]UnknownPlayer[/eluser]
Hi,
i need help with time helper and mysql functions.
I have set default time zone to US in config.php, my server is not there but anyway i set that timezone, if this is wrong tell me:
Code:
date_default_timezone_set('America/New_York');

i set codeigniter to use gmt, and in controllers i use like this:
Code:
$now = now();

        $timezone = 'UP1';

        $now = gmt_to_local($now, $timezone);

        echo unix_to_human($now, TRUE, 'eu');

but in mysql some fields use CURRENT_TIMESTAMP function, should i remove that with int(10), and add that manually timestamp as int ?

Or can i set in mysql:
Code:
SET time_zone = timezone;

and now NEW() and CURRENT_TIMESTAMP will work ok ?
But codeigniter use gmt, so i am confused if this solution will work ?




Theme © iAndrew 2016 - Forum software by © MyBB