?
Solved

Getting the Day Part of my DATE Field in Mysql PHP

Posted on 2009-02-17
2
Medium Priority
?
295 Views
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
$row['DOB']

Open in new window

0
Comment
Question by:Campbellh
2 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 23660199
you should modify the query to return a field with date value, using DATE_FORMAT() function:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 2000 total points
ID: 23667833
It is very simple, just modify your sql where you retrieve.


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

Open in new window

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

840 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