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

  • Home
  • SEARCH
  • 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 8780979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:11:14+00:00 2026-06-13T20:11:14+00:00

I have a comment area on my website and each comment displays when it

  • 0

I have a comment area on my website and each comment displays when it was posted in the normal date format (05/Nov/2012)… But I would like to display ‘1 day ago’ of even ‘3 hours ago’ instead of the normal format… Here’s what I have so far:

SELECT p.poll_id, p.title, date_format(c.posted, '%D %b %y') as time, COUNT( c.poll_id ) AS count, u.username
FROM users AS u
JOIN polls AS p ON u.user_id = p.user_id
LEFT JOIN comment AS c ON p.poll_id = c.poll_id
LIMIT 5 
  • 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-13T20:11:14+00:00Added an answer on June 13, 2026 at 8:11 pm

    Use date difference function to evaluate date difference

    SELECT p.poll_id, p.title,  DATEDIFF(NOW(), c.posted) AS daysold, COUNT( c.poll_id ) AS   count, u.username
      FROM users AS u
      JOIN polls AS p ON u.user_id = p.user_id
      LEFT JOIN comment AS c ON p.poll_id = c.poll_id
      LIMIT 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple html/css-only static website on which I would like to add
I have a Comment model in my app but am encountering a lot of
Currently I am have a comment which belongs to a micropost, but the issue
I made a commenting system that would comment under a micropost but the issue
I have what I thought was a pretty simple area of my webpage, but
I have rails app with a textarea form like <%= form_for Comment.new, :remote =>
I have a Comment model with the acts_as_nested_set enabled, but when I try to
I have Comment as a polymorphic model. It is attached to Post, Review, etc.
I hope I am clear enough. My data set is populated I have comment:CommentVO;
I have a Comment class with a :foreign_key of post_id in the Post class.

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.