The date filter accepts strings (it must be in a format supported by the
strtotime function), DateTime instances, or DateInterval instances. For
instance, to display the current date, filter the word "now":

1

{{"now"|date("m/d/Y")}}

To escape words and characters in the date format use \\ in front of each
character:

1

{{post.published_at|date("F jS \\a\\t g:ia")}}

If the value passed to the date filter is null, it will return the
current date by default. If an empty string is desired instead of the current
date, use a ternary operator:

If no format is provided, Twig will use the default one: F j, Y H:i. This
default can be easily changed by calling the setDateFormat() method on the
core extension instance. The first argument is the default format for
dates and the second one is the default format for date intervals: