Title: dates
Last modified: August 31, 2016

---

# dates

 *  [aline.andrade](https://wordpress.org/support/users/alineandrade/)
 * (@alineandrade)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/dates-9/)
 * I created a post and called the date by
 * `<? php the_time (); ?>`
 * But the date is in English, how do I change?
 * [https://wordpress.org/plugins/xili-language/](https://wordpress.org/plugins/xili-language/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Michel – xiligroup dev](https://wordpress.org/support/users/michelwppi/)
 * (@michelwppi)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/dates-9/#post-6971878)
 * `the_time()` is a without param function… In WP (and more in multilingual context)
   you must use wp functions as used in bundled theme like twenty fourteen. The 
   date format (defined in general settings) will be translated if date format in
   current language .mo.
    M.
 *  Thread Starter [aline.andrade](https://wordpress.org/support/users/alineandrade/)
 * (@alineandrade)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/dates-9/#post-6972082)
 * I put the tool and worked to format the date.
 *     ```
       /*formatar a data*/
       function my_date($thedate,$theformat) {
         /* param no used because php format */
         /*return the_xili_local_time('%d %B %Y - %H:%M',strtotime(get_the_time('d/M/Y H:i')));    */
         if (the_curlang() == "pt" ) {
         		return the_xili_local_time('%d ' . de . ' %B ' . de . ' %Y',strtotime(get_the_time('d/M/Y')));
         } else {
       	   return the_xili_local_time('%d' . th . ' %B %Y',strtotime(get_the_time('d/M/Y')));
         }
       }
       add_filter('the_date','my_date',10,2);
       ```
   
 * Now how do I format the date of a custom field
    `<p class="data"><?php the_field('
   data-evento'); ?></p>`
 *  Thread Starter [aline.andrade](https://wordpress.org/support/users/alineandrade/)
 * (@alineandrade)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/dates-9/#post-6972084)
 * It returns the month in English and weekday in Portuguese.
    I want him back Tue
   24 Aug and 24 Agos ter
 *     ```
       <?php $recent = new WP_Query("cat=28&showposts=5&lang=en"); while($recent->have_posts()) : $recent->the_post();?>
       <p class="data"><?php the_field('data-evento'); ?></p>
       <?php endwhile; ?>
       ```
   
 * and
 *     ```
       <?php $recent = new WP_Query("cat=28&showposts=5&lang=pt"); while($recent->have_posts()) : $recent->the_post();?>
       <p class="data"><?php the_field('data-evento'); ?></p>
       <?php endwhile; ?>
       ```
   
 *  Plugin Author [Michel – xiligroup dev](https://wordpress.org/support/users/michelwppi/)
 * (@michelwppi)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/dates-9/#post-6972149)
 * Tha date formatting depends of the language of the current web page if gettext
   method/functions are used…
    To save “formatted” datas in custom fields, you must
   use customized format (and library) used in specific functions. To go deeper,
   this forum is not totally the right place. M.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘dates’ is closed to new replies.

 * ![](https://ps.w.org/xili-language/assets/icon-256x256.png?rev=970404)
 * [xili-language](https://wordpress.org/plugins/xili-language/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/xili-language/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/xili-language/)
 * [Active Topics](https://wordpress.org/support/plugin/xili-language/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/xili-language/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/xili-language/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Michel – xiligroup dev](https://wordpress.org/support/users/michelwppi/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/dates-9/#post-6972149)
 * Status: not resolved