Meta Box
Support › General › Displaying Time Data
the default behavior for the time fields is 24 hour time. how to convert to 12 hour display on the front end?
anyone have any idea about this? I need 12h format, not 24h
thx
Hi Neil,
You can convert the format using PHP date() function. Assuming your time has format "04:20 PM", and you want to convert to "16:20", here is the code:
date()
$time = rwmb_meta( 'field_id' ); // 04:20 PM echo date( 'H:i', strtotime( $time ) ); // 16:20
See more answers here.