0

In a view using Articles and Blog posts sorted by recent post date, I'm using [Content: Post date] and I would like to display (as a column on the display) as only the date and not the time, i.e. 2016/04/08.

I merely wish to alter what data Drupal is displaying, not the data it is collecting.

How can I apply this date format to the field in the view?

In Home>Administration>Date and Time, I can add new date type but all 19 of the options include displays of time.

2 Answers 2

1

There should also be a Formats tab at the top of that page. Here you can add additional formatting (like date or time only formats). After saving the format, go back to the first page and now you can select your newly created format as an option.

Formats tab

2
  • I see @Neograph734! I didn't even see that tab on the right side. Neverthe less, mine was emply. It also directs people to review the PHP manual. I think your solution is ultimately better than mine because it will be available when I next want to use it for something else.
    – TdeV
    Commented Apr 8, 2016 at 21:42
  • Yes that is correct, you need to create them yourself. The PHP manual provides details on what tokens to use. Depending on your locale I cannot give you a simple code. It is really easy. You are probably looking for something like D M d. Commented Apr 8, 2016 at 21:44
0

Aha! Minutes after I post, I discover something else.

In the configuration of the Date Field in the Fields section of the View, I have more features, namely the ability to create a Custom Date format (no Custom in the Amin>Date and Time).

Selecting custom, I used this excellent manual http://php.net/manual/en/function.date.php

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.