I have date format and would like to translate to another language with date_i18n
function how can I integrate with get_post_time here is my code :
$time = get_post_time('F j, Y', true,$newspost['ID']);
I have date format and would like to translate to another language with date_i18n
function how can I integrate with get_post_time here is my code :
$time = get_post_time('F j, Y', true,$newspost['ID']);
Comments are closed.
Use the fourth parameter for
get_post_time()
:get_post_time()
callsmysql2date()
internally, and it passes the$translate
argument through. Inmysql2date()
we find this:So, all you need is a single
TRUE
.For a test, try this:
Then install at least one other language and the plugin WCM User Language Switcher. Viewing the front end, we get different month names when we switch the language now.
get_post_modified_time()
works with the same arguments.