Title: Getting Date with Format
Last modified: August 20, 2016

---

# Getting Date with Format

 *  [mridl200](https://wordpress.org/support/users/mridl200/)
 * (@mridl200)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/getting-date-with-format/)
 * Hi guys,
 * This I believe should be something simple, however I couldnt get it to work correctly
   so after a quick search without finding anything I came here.
 * I simply want to add the current date to the bottom of my webpage using Widget
   Logic. I looked up the PHP to do this and used
    <?php print_r(getdate()); ?> 
   This however will not load anything.
 * Does anyone have a solution to this? Or know of a better way for me to go about
   it?
 * Thanks in advance.
 * [http://wordpress.org/extend/plugins/widget-logic/](http://wordpress.org/extend/plugins/widget-logic/)

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

 *  Thread Starter [mridl200](https://wordpress.org/support/users/mridl200/)
 * (@mridl200)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/getting-date-with-format/#post-3435291)
 * An update,
    It seems the problem I was having was that I used the <?php tags 
   inside the logic. Now I can display a time properly, so as a follow up question
   is there a way to display text, followed by the year? For example I am using 
   a text box that has “Created by xxx on “Date”” Where date is I would like to 
   use Widget logic to display the year (so really I am just using print_r(date(“
   Y”))).
 * Thanks again.
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/getting-date-with-format/#post-3435400)
 * You could do this with WL – ideally by using the widget_content filter on an 
   existing widget. But there are PHP widgets out there that you can place in sidebars
   and widgetised-footers that you can put in the specific code you want – and that
   would be way easier I think.

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

The topic ‘Getting Date with Format’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 2 replies
 * 2 participants
 * Last reply from: [alanft](https://wordpress.org/support/users/alanft/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/getting-date-with-format/#post-3435400)
 * Status: not resolved