I am trying to check game_id
only for today or current date and for this I am trying following script
$todayExist = Training::whereRaw("Date(created_at)=Curdate() and game_id=$game_id")->get();
if($todayExist->count() > 0 ){
$error = 1;
$result = false;
}
The above query output is
select * from `games_training` where Date(created_at)=Curdate() and game_id=6
But for game_id=6
there is duplicate entry, as it was generated by 3 hours ago (Dubai Time).
So can someone kindly guide me what can be the issue? Is it wrong query or it happened because server timezone.
I just insert record, in server database it is showing 09:31:57
which mean is 09:31 AM, however I am in Dubai and right now here is 1:33 PM.
Can someone kindly guide me about it.
Thank you so much.