Issue
I want to convert the user's time, eg. 08:45 P.M
, to UTC time zone. How can I do that?
if ($request->open_at)
{
$time = Carbon::parse($request->open_at)->toUTCString();
dd($time);
$query->whereTime('open_at', '>=', $time);
}
Solution
Use this PHP approach:
$time = new DateTime("08:45 P.M");
$time ->setTimezone(new DateTimeZone("UTC"));
echo $time ->format("Y-m-d H:i:s e");
Answered By - Faizan Ali
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.