Sticking My Nose in Where It Doesn’t Belong

To answer unanswered WordPress Forum Questions,
or not answer them: that is the question:
Whether ’tis nobler in the mind to suffer
The slings and arrows of unanswered questions,
Or to take up the questions myself,
And by answering them end any possibility of
REAL WordPress experts finding and answering them?

I’ve been looking at the WordPress Forum for a way to format posts based on when they were posted, in addition to formatting with category templates. Instead I found an unanswered thread asking how to format time in the “traditional” way, as “two-thirty” or “three o’clock” rather than “2:30” or “3:00 pm.”

So I did a little search and found this thread, which mentions these PHP codes.

The time is < ?php print date("H:i") ?>. 
That means it's < ?php print date("i") ?>
minutes past < ?php print date("H") ?> o'clock.

Which will give you an output like this:

The time is 15:26. That means it’s 26 minutes past 15 o’clock.

I tried it on my site and it worked, but it gave me output just like the example: “15 o’clock,” rather than “3 o’clock.”

The other URL mentioned in the thread says lower case “g” will give you a “12-hour format of an hour without leading zeros” and I tried this:

The time is < ?php print date("g:i") ?>. 
That means it's < ?php print date("i") ?>
minutes past < ?php print date("g") ?> o'clock.

And I got:

The time is 3:26. That means it’s 26 minutes past 3 o’clock.

Wow. Maybe PHP isn’t the monster I thought it was. I actually answered a forum question in a helpful way!

But then I began to worry that my answer wasn’t NOT the correct way to do it, and by answering that guy’s question I turned the single post thread into a double post thread, which means REAL WordPress gurus won’t be able to find it, and dang, why do I worry about this stuff anyway?

3 Replies to “Sticking My Nose in Where It Doesn’t Belong”

  1. I think any amount of help you can provide to other WordPress users is invaluable, if nothing more than a direction to look at. I think virtually everyone wants to learn enough of PHP, MySQL, WordPress and website administration in general to be able to manage things by themselves.

    And if you end up learning something while trying to help someone else out, then two people benefit, right? šŸ™‚

    Besides, I’m sure the WordPress “Guru’s” (whoever they are) will appreciate all the help they can get with the forum questions.

    Regards

  2. And if you end up learning something while trying to help someone else out, then two people benefit, right?

    True—I did learn a little PHP, after all. Pretty much a miracle, if you ask me!

  3. There are no WordPress gurus, unless you count Matt Mullenweg. šŸ˜‰

    We are all just people who figured it out the hard way and give a little of our time to answer a question now and then. Be brave. If you figure it out or know the answer, post it. If you screw up, I’m sure that “someone” will come along and smack you – I mean, fix it.

    We all need all the help we can get.

    Besides, I’ve been teaching for many years and live by a great creedo/quote I learned a long time ago:

    You teach best what you most need to learn

    By the way, awesome site. I love the subtitle. I hate lawns and in our photography programs and workshops recommend people turn their lawns into wildlife habitats when possible, so I had a great laugh of joy over your subtitle. Perfect.

    Keep up the great work.

Leave a Reply