Is there a way to display the current date on views? I just realized that I couldn't use global tokens nor could I get custom date created on Display Suite on views.


1 Answer 1

  1. Install Token Filter.
  2. Got to Configuration > Text Formats and enable Token Filter ("Replace Tokens") for a text format.
  3. In your view add Header/Footer "Global: Text Area" and choose the text format from step 2.
  4. In the text area write [current-date:short] and optionally check [x] Display even if view has no result.

Source: https://ffwagency.com/digital-strategies-blog/how-add-current-date-view-drupal-7

To do this in the fields section use Advanced Text Formatter, which allows you to choose a text format for "Global: Custom text" fields.

Source: https://www.drupal.org/project/views/issues/1417266#comment-12245061

  • Hi @leymannx thanks a lot for the response. I didn't think about adding it to header footer, thank you for the tip. But I actually need it in the field section, is there a way for it as well
    – Efe
    May 15, 2018 at 11:57
  • Hey @Efe, updated answer.
    – leymannx
    May 15, 2018 at 12:05
  • @leymannx there is no option for Global: Custom text, only for Text content type fields. Feb 15, 2022 at 20:14
  • @user3108268 – This answer is for Drupal 7.
    – leymannx
    Feb 16, 2022 at 11:07
  • @leymannx yes, my response is also to Drupal 7. Advanced Text Formatter does not work for Global: Custom text, there is no text formatter option at all. However the formatter appears for text fields. Feb 16, 2022 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.