I am trying to get the todays date , day and time .
Today is : 10th july 2018,tuesday and time is 3.23am
For time the below code works fine:
$wpplcurrenttime = current_time( 'g:i a', $gmt = 0 ); echo $wpplcurrenttime;
and out put is: 3.23 am which is correct
But strangely the date is not getting correct : the returned date is 9th july 2018,Monday
These are the codes i tried :
$dw = date('l'); echo $dw; echo date(get_option('date_format')); echo date('l jS F Y'); echo gmdate('w');
All of above codes gives a wrong date and day. I have double checked the WordPress general setting it is showing the date and time correctly.
Really appreciate the help Thanks