WordPress.org

Ready to get started?Download WordPress

Forums

Latin/Roman Numeral Date/Year (4 posts)

  1. anhunt
    Member
    Posted 8 years ago #

    Is there any way to make the default date format use roman numerals? For instance I'd like to be able to display today's date as 29th of June MMV.

    I scoured the php manuals and didn't see this as an option. Is there anybody that's tried to do this before? Anyone with a workaround?

  2. Kafkaesqui

    Posted 8 years ago #

    How about a plugin?

    Year2Roman:
    download | view code

    Extract and Upload year2roman.php to your plugins directory, then activate Year2Roman under Plugins. Usage examples are in plugin, but here's an example using it with the_date():

    <?php the_date('j\t\h \o\f F ','',get_year2roman()); ?>

    The date format string ('j\t\h \o\f F ') generates "29th of June ".

    Nod to Hugh Bothwell, who provided the engine to this here:

    http://www.phpbuilder.com/lists/php-db/2003061/0349.php

  3. anhunt
    Member
    Posted 8 years ago #

    Make that:

    <?php the_date('jS of F ','',get_year2roman()); ?>

    everything in it, follows the PHP date() function syntax except for the ','',get_year2roman()

    for those more less familiar, once the plugin is installed, the above code get's copied into the Main Template or:
    wp-content/themes/yourthemenamehere/index.php

    enabling this plugin will disable the ability to control the date formatting through the Options > Date and Time menu.

    Thanks for the help Kafkaesqui.

  4. anhunt
    Member
    Posted 8 years ago #

    has anyone had success implementing this "year2roman" plugin in the "archives" display (as opposed to just the main index.php page)?

Topic Closed

This topic has been closed to new replies.

About this Topic