PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Date display localization

  1. snoop
    Member

    I have a form which allows users to make posts. The form also uses custom field variable which is formed with date picker. I'm using the below code to display this date on the frontend.

    <?php $key = "custom-date"; echo $display_date = date('j. F Y', strtotime(get_meta($key))); ?>

    The problem I have is that strtotime is using English names of the months. Is there any way I can replace them with custom names (local)?

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  2. I'm not 100% sure what the issue is. Is the issue with strtotime or Gravity Forms? strtotime is a core PHP function and not a function of Gravity Forms itself. Are you trying to transform the date that Gravity Forms stores in the custom field and display it in a different format?

    Posted 12 years ago on Friday November 18, 2011 | Permalink
  3. Sounds like this might help:
    http://stackoverflow.com/questions/6988536/strtotime-with-different-languages

    Posted 12 years ago on Saturday November 19, 2011 | Permalink
  4. snoop
    Member

    "Are you trying to transform the date that Gravity Forms stores in the custom field and display it in a different format?" YES!

    I would like to display the stored date in "j. F Y" format and that month names would be loaded from wp-includes/locale.php . I'm pretty sure it cannot be done with strtotime.

    Chris thanks for the link but it doesnt work. Maybe I did something wrong or it cannot be done this way..

    Any suggestions?

    Posted 12 years ago on Saturday November 19, 2011 | Permalink