date format and sorting
-
Hello. I have a query like bellow and i would like to have the output collum (AS prazo) like d-m-Y.
Every time i query a date custom field the output is like: m-d-Y, but i want d-m-Y…
TxSELECT wp_posts.post_title AS 'Ocorrência', GROUP_CONCAT(if(meta_key = 'ocorrencias_prazo', date_format(meta_value, '%d/%m/%Y'), NULL)) AS 'Prazo', GROUP_CONCAT(if(meta_key = 'ocorrencias_prazo', meta_value, NULL)) AS 'Prazo2', date_format(post_date, '%d/%m/%Y') AS 'Data do Post' FROM wp_postmeta left JOIN wp_posts ON wp_postmeta.post_id = wp_posts.ID left JOIN wp_users ON wp_posts.post_author = wp_users.ID where wp_posts.post_type = 'ocorrencia' AND wp_posts.post_title LIKE 'TWR%' AND wp_posts.post_status = 'publish' GROUP BY post_id order by post_date ASC ;
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
https://www.ads-software.com/plugins/custom-content-type-manager/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘date format and sorting’ is closed to new replies.