display date php code query
-
Hi. I hope I am posting this in the correct section. I have found a small snippet of code which displays the current date on my page. The code is:
// [date]
function displaydate(){
return date(‘l, F jS, Y’);
}
add_shortcode(‘date’, ‘displaydate’);
// end date
This works perfectly on my site https://www.billhughes.co.uk.
I am not very conversant with php and wondered whether anyone could tell me where the code gets the current time/date from . Does it get local time, wherever you are viewing the page in the world, or does it get its time from the host server (which is in America)? In other words would the date change at the correct time locally for the viewer?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘display date php code query’ is closed to new replies.