T
T
theEternalStudent2015-11-27 10:47:38
MODX
theEternalStudent, 2015-11-27 10:47:38

The year is displayed incorrectly (6699-11-27). What's wrong?

Hello. I display the dates of documents through pdoResources like this: . And I get instead of 2015-11-27 - 6699-11-27... What's wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
theEternalStudent, 2015-11-27
@theEternalStudent

The solution was

O
Optimus, 2015-11-27
Pyan @marrk2

because strtotime needs to be converted to a date first

$Year = date("Y", $strtotime);

V
Vladimir Rebrov, 2015-11-27
@Rebroff

Because it's a pdoResources placeholder that doesn't translate the numeric representation of the date into a string after fetching it from the database. For this, the use of strtotime is redundant. Only the actual date placeholder and format modifier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question