Using PHP how do you get the number of seconds elapsed since midnight of the current day?
All i've tried right now is:
$hour=substr(date("h:i:s"),0,2); $minute=substr(date("h:i:s"),3,2); echo $hour."\r\n"; echo $minute."\r\n";
...but it doesn't return the correct server time of the response and I don't know how to do that.
This should work.
echo time() - strtotime("today");
This will only show your servers timezone though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With