• Hello,

    In post there is for example “Publicated about 12 hours ago”. I want to changed it to “Publicated 10.01.2015”. I have found that code below is probably responsible for this. Does anyone know how to change it?

    Published <span class=\"entry-date\"><time class=\"entry-date\" datetime=\"%1$s\">%2$s</time></span> at <a href=\"%3$s\">%4$s &times; %5$s</a> in <a href=\"%6$s\" rel=\"gallery\">%7$s</a>

    best regards,

Viewing 1 replies (of 1 total)
  • The text for “about 12 hours ago” is generated by a call to function “human_time_diff” in file “wp-includes/formatting.php”
    You will want to replace the result it returns.
    It is trickier than you expect since the time has to be corrected for your timezone (it would be better if it were the viewer’s timezone) before calculating the date. Please also be aware that there are different date conventions, commonest in the USA is “mm-dd-yyyy” while the rest of the world mostly use “dd-mm-yyyy”, unambiguous options are “yyyy-mm-dd” or “dd-mmm-yyyy”, where mmm is the 3 character month apreviation like “Jan”. Also keep in mind that one day you might want the website to be translated.

Viewing 1 replies (of 1 total)
  • The topic ‘Change datetime in posts’ is closed to new replies.