New answers tagged

2

The correct function to use for what you describe would be date_i18n() WordPress function. It will produce output that is correct for timezone configured in WordPress and also localized if necessary.


-1

To get date, time from the timestamp you can use echo date('h:m:s d-m-Y',141234567890); This will give you the output 11:03:02 06-03-1954


0

found WP built-in function get_date_from_gmt : get_date_from_gmt('13:49:18 26/05/2016') or get_date_from_gmt(strtotime('13:49:18 26/05/2016'))


2

Just use date_i18n in multiple places with PHP date arguments just for what you need: if ( $date = get_post_meta( $thepostid, '_sale_price_dates_to', true ) ) { $sale_price_dates_to = '<span class="m">' . date_i18n( 'M', $date ) . '</span> ' . '<span class="d">' . date_i18n( 'j', $date ) . '</span> ' . ...



Top 50 recent answers are included