WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Date/time formatting error (3 posts)

  1. aaronh
    Member
    Posted 8 years ago #

    When I call the_date() or the_time() with string arguments they return a {1} in front of the string. When I call those functions with numeric arguments they return fine.

    For example:

    the_date('l, F j, Y') returns {1}Saturday,${1}July 2, 2006
    the_date('F j, Y') returns {1}July 2, 2006

    On the other hand, numeric (and am/pm) arguments are no problem:

    the_date('g:i a') returns 11.14 am
    the_date('m.j.y') returns 07.1.02

    as they should.

    Calling the_time() with the same arguments produces the same results.

    Any help would be appreciated.

  2. Nazgul
    Member
    Posted 8 years ago #

    It has to do with and old version of PHP in combination with a change they made in WordPress 2.0.3.

    They fixed it in the yet to be released 2.0.4 version, but take a look at this topic for some workarounds in the meantime.

  3. aaronh
    Member
    Posted 8 years ago #

    Modifying the mysql2date() call, as recommended in the topic you referenced, fixed the problem. Apologies for reposting; somehow my search missed the original topic.

Topic Closed

This topic has been closed to new replies.

About this Topic