Getting the Day Part of my DATE Field in Mysql PHP

Posted on 2009-02-17
Last Modified: 2012-05-06
Hello Guys

I have a date field in my mysql database, I would like to get the Day Part

eg I have 12/02/2009  and i would just like to get  February 12 from it.

Thanks for any help

Open in new window

Question by:Campbellh
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    you should modify the query to return a field with date value, using DATE_FORMAT() function:
    LVL 36

    Accepted Solution

    It is very simple, just modify your sql where you retrieve.

    SELECT DATE_FORMAT(db_date_field, '%M %d');

    Open in new window


    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
    This article will show, step by step, how to integrate R code into a R Sweave document
    Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now