How to get Current Datetime of user with timezone

i have used this

global $timedate;

$CurrenrDateTime = $timedate->getInstance()->nowDb(); //This will give database datetime

please help

Parents
  • Hello Mehul,

    If I have understood your query correctly, following should do the trick.

    global $timedate;

    $CurrenrDateTime = $timedate->now();

Reply
  • Hello Mehul,

    If I have understood your query correctly, following should do the trick.

    global $timedate;

    $CurrenrDateTime = $timedate->now();

Children
No Data