Title: display date php code query
Last modified: August 21, 2016

---

# display date php code query

 *  [billh65](https://wordpress.org/support/users/billh65/)
 * (@billh65)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/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 [http://www.billhughes.co.uk](http://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)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/display-date-php-code-query/#post-4994706)
 * It gets it from the time set on your server. The server time that the site sees
   is also set by what’s in the ‘Settings -> General’ page in your admin area.
 *  Thread Starter [billh65](https://wordpress.org/support/users/billh65/)
 * (@billh65)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/display-date-php-code-query/#post-4994710)
 * Thanks catacaustic. As I said I am not very well up on php. My time is set to
   London (UK time) in my admin page settings. So will everyone in the world see
   the date change at midnight UK time?
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/display-date-php-code-query/#post-4994711)
 * Yes they should. You’ll be able to see what time that outputs, so have a look
   and see that it matches your local time. If it does, then you’ll be fine.
 *  Thread Starter [billh65](https://wordpress.org/support/users/billh65/)
 * (@billh65)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/display-date-php-code-query/#post-4994722)
 * Thanks catacaustic, much appreciated

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘display date php code query’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [billh65](https://wordpress.org/support/users/billh65/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/display-date-php-code-query/#post-4994722)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
