• Does anybody know how I could go about displaying the year in my WordPress blog posts like this: TWO THOUSAND FOURTEEN

    Instead of the usual: 2014

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    WordPress handles date and time display by relying on Php’s date/time documentation, and so while I won’t say it’s not possible, I don’t think there’s anything in that documentation that allows for the display of dates in letters instead of numbers. You can check the date/time documentation page that’s linked from the date/time section in settings/general of your WordPress dashboard.

    Thread Starter davidzupec

    (@davidzupec)

    Hi Amanda, yeah I know I was afraid of that. I had looked at the codex and nothing was in there about the format that I want. Thank you for your help.

    I played around with this and found this StackOverflow post. If you take the functions from the top answer and paste them into your theme’s functions.php file and then use this in your template:

    <?php echo strtoupper(convertNumber(get_the_date('Y'))); ?>

    For 2014 you end up with TWO THOUSAND AND FOURTEEN.

    It’s a bit of cracking a nut with a sledge hammer but I have it working on my test site. You could use it in conjunction with another the_date() string to form the output you require.

    Thread Starter davidzupec

    (@davidzupec)

    Hi WPRanger, great thank you! I’ll give this a shot. When I designed my clients site I wanted to do something different with the post year, but I didn’t think this format would end up being complicated : )

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Date format’ is closed to new replies.