Solved

print date form mysql database php

Posted on 2008-06-17
3
776 Views
Last Modified: 2012-05-05
<?php echo $row_billhead1['dateIssuse']; ?>

The output is  2008-06-18 13:44:03   how can i change it to 18-06-2008
0
Comment
Question by:teera
  • 2
3 Comments
 
LVL 1

Expert Comment

by:MikeBusby
ID: 21810659
Whats the field type in your database?

time?

or just text?

if its time then you can manipulate it.. but if its text you could still do it with string manipulation but thats alot harder...
0
 
LVL 6

Expert Comment

by:deresh
ID: 21810738
here you go ;)


<?php echo date("d-m-Y",strtotime($row_billhead1['dateIssuse']) ?>

Open in new window

0
 
LVL 6

Accepted Solution

by:
deresh earned 300 total points
ID: 21810739
sorry this one is correct, missing ) in last one :)


<?php echo date("d-m-Y",strtotime($row_billhead1['dateIssuse'])) ?>

Open in new window

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

776 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