Question: I want to use the following code

```
the_time('d. F Y', '<p class="article-date">', '</p>');

```

to show the date of an article (post) wrapped within `<p></p>`. I also tried

```
 echo '<p class="article-date">' .  the_time('d. F Y') . '</p>';

```

but again the date isn't placed in those tags. What I'm doing wrong? I have a normal `foreach` and no `endforeach` and so on.

Answer: 
```
<p>
    <?php the_time() ?>
</p>

```

It helps with separation of concerns and increases readability of code as well as being consistent with WordPress coding standards and the default coding style.

The first method you attempted is completely invalid, `the_time()` only accepts 1 parameter, the date format. The second method has roots in validity, but `the_time()` itself is already doing an `echo`, so by calling it in the middle of the string, you're preempting the outer `echo` and probably getting the time and an empty `p`. If you want to use that method you can go with this:

```
echo '<p>' . get_the_time() . '</p>';

```

Since `get_the_time()` `return`s its value whereas `the_time()` `echo`s it.

### Edit

To use the `$format` parameter correctly:

```
<?php the_time( 'd. F Y' ) ?>

```

Note: for a publicly released Theme, it is recommended to use the user-defined date/time format:

```
<?php the_time( get_option( 'time_format' ) ); ?>

```

You can also pass the date format to `the_time()` if you need to output the date for each post in the loop. The `the_date()` function only outputs the date upon the first occurrence. So, if multiple posts have the same date, the date will only be output once. To get around this limitation, use `the_time( $date_format )` instead:

```
<?php the_time( get_option( 'date_format' ) ); ?>

```
about your first line of code: 

[`the_time()`](http://codex.wordpress.org/Function_Reference/the_time) only uses one parameter.

about your second line of code:

if you want to use 'the\_time' in a string concatenation, use [`get_the_time()`](http://codex.wordpress.org/Function_Reference/get_the_time) :

example:

```
echo '<p class="article-date">' . get_the_time('d. F Y') . '</p>';

```