Solved

SUPER EASY php mysql date display

Posted on 2008-06-10
4
212 Views
Last Modified: 2008-06-10
how do you take a date variable from a mysql database and display it in the date format you choose?
ie.
$db_date=mysql_result($result,$i,"db_date");
$formated_date=$db_date(M,d,Y);
0
Comment
Question by:newbe101
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
Comment Utility
use strtotime and date

$formated_date = date('M,d,Y', strtotime(mysql_result($result,$i,"db_date")));

See http://www.php.net/date and http://www.php.net/strtotime

how does the date from the db look?
0
 
LVL 14

Expert Comment

by:ali_kayahan
Comment Utility
$date = date("M,d,Y",$db_date) ;
0
 
LVL 14

Expert Comment

by:ali_kayahan
Comment Utility
It will work if you populate your field with time()
0
 

Author Comment

by:newbe101
Comment Utility
Thank you again, hernst42 !
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

743 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

12 Experts available now in Live!

Get 1:1 Help Now