WordPress: How to Display Date and Time with User-preferred Formatting

wpdatetimesettings
We set Date Format and Time Format in WordPress General Setting and we want to display that date on WordPress template. The Date Format and the Time Format settings allow us to set Date and Time to any format we wants, it also easier to use with localization. Use following code in WordPress template
Date

<?php the_time(get_option('date_format')); ?>

Time

<?php the_time(get_option('time_format')); ?>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: