i'm saving login time for php . this is what i use to save value against every login
$update= mysqli_query($connection, "UPDATE employees set loggedin= now() WHERE email = '$email'");
when i get values from
$logintime_query= mysqli_fetc h_assoc($logintime);
$loggedin_time_converted= explode(" ",$logintime_query) ;
$converted_time= $loggedin_time_converted['0'];
$converted_date= $loggedin_time_converted['1'];
now i've to compare this date with today's date , to get today's date i am using this
$today= $_SERVER['REQUEST_TIME'];
echo(date("Y-m-d",$today));
now problem is that $_SERVER['REQUEST_TIME]
is giving me this date
2015-12-21
and when i enter date using NOW() and retrieve it from DB this is what i get
2015-12-20
is it time zone issue or what ? my time zone is utc+4 (Dubai) so i tried to set it like this
date_default_timezone_set('Asia/Dubai');
but this does not work some one please help me to figure this out