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 7728943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:50:40+00:00 2026-06-01T05:50:40+00:00

I have records with no time attached so, with the rss feed I’m just

  • 0

I have records with no time attached so, with the rss feed I’m just getting 00:00.

I need help customizing this code to remove the time but, keep the date.

Any help would be great as I have been playing with this for fat too long 🙂

 $get_courses = "SELECT 
     courses.course_id, 
     DATE_FORMAT(courses.date_added,'%a %b %e %Y') as formatted_date_added, 
     courses.course_type, 
     courses.start_date, 
     location_name, 
     price, 
     duration 
 FROM courses 
 JOIN addresses ON courses.course_get_address_id = addresses.address_id 
 WHERE courses.active = 'Active' 
 ORDER BY courses.date_added DESC 
 LIMIT 30";

XML

 '<pubDate>'.$course['formatted_date_added'].' GMT</pubDate>'
  • 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-01T05:50:41+00:00Added an answer on June 1, 2026 at 5:50 am

    Change

    DATE_FORMAT(courses.date_added,'%a %b %e %Y') as formatted_date_added
    

    to

    UNIX_TIMESTAMP(courses.date_added) as formatted_date_added
    

    and in PHP:

    if (date("H:i", $tuple["when"]) == "00:00")
        // without time
        echo '<pubDate>'.strftime('%a %b %e %Y', 
            $course['formatted_date_added']).' GMT</pubDate>';
    else
        // with time
        echo '<pubDate>'.strftime('%a %b %e %Y %r', 
            $course['formatted_date_added']).' GMT</pubDate>';
    

    Or just output

    '<pubDate>'.strftime('%a %b %e %Y', $course['formatted_date_added']).' GMT</pubDate>'
    

    if you won’t ever have time information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some records like this: ID Personel_Code Time --- ------------- ------ 1 0011
I have this homework question: Assume a Database table has 0 records at time
I have records with a time value and need to be able to query
I have a table record where I am storing records of time like this:
How can I have a column in a table which records the time which
I have a database with a large number of records that are Date/Time stamped.
I have table with date/time column and person column. Each person has multiple records
I have a table containing view/click records. The time is stored in a unix
I'm tinkering with CodeIgniter and have come across Active Records for the first time.
I have a mySQL db with duplicate records, as from the attached image. I

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.