Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:39:15+00:00 2026-06-01T07:39:15+00:00

So, I am implementing twitter via twitter widget pro into a wordpress theme. I’m

  • 0

So, I am implementing twitter via twitter widget pro into a wordpress theme. I’m wanting to date the tweets differently from wordpress and from the widgets formats. I want to follow twitters date format of 5h, 23h, or 3 Mar. All I’ve been able to find is how to do the “created _ ago” “about _ old” etc… I just want to use the xh if within 24 hours, otherwise use the day and month abbreviation. I really don’t know php or too much js, so any help is very very much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:39:16+00:00Added an answer on June 1, 2026 at 7:39 am

    Use PHP DateTime and DateInterval classes,

    $dt1 = new DateTime("2012-02-10 10:32:22");
    $dt2 = new DateTime();
    $diff = $dt2->diff($dt1);
    echo $diff->format("%Y years, %m months, %d days, %H hours, %I minuts, %s seconds ago");
    /// 00 years, 1 months, 18 days, 08 hours, 26 minuts, 51 seconds ago
    

    If you dont want to echo 00 years, 00 months etc then check DateTime::y, DateTime::m etc properties is 0. if zero dont echo them. For example,

    $format = "";
    if ($diff->y > 0){
        $format.="%Y years,";
    }
    if ($diff->m > 0){
        $format.="%m months,";
    }
    ...
    // more conditions for hours, minutes, seconds
    
    // echo the format
    echo $diff->format($format);
    

    Links of Interest,

    1. DateTime::__construct()
    2. DateTime::diff()
    3. DateInterval::format()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at implementing an app getting Twitter authorization via Oauth in Java. The
I'm implementing an Auto-Twitter feature into my website that allows users to Auto-Post content
We just finished implementing OAuth in our RoR application using the Twitter gem .
It seems like implementing web-app like twitter/facebook-wall needs 1 huge feeds relational table (+
Firstly I design the site & convert it into HTML using Twitter bootstrap. The
I'm implementing a form, whereby I'm wanting to disable a button and show a
I am implementing the twitter app like animation of the #Discover tab. When the
As far as I understand Theme Switcher Widget is designed for use on demo
issue during implementing twitter API. when i send a request using http://twitter.com/statuses/friends_timeline.xml i got
I am implementing a Twitter app, where the app needs to cache details of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.