( PHP ) How do I display MySQL Date Formatted?

Posted on 2006-05-08
Last Modified: 2010-08-05

I can insert the current date into mysql and display it no problem,
but the formatting is not that nice when it gets displayed.

How can I make the date display like this = 08.05.06

Question by:babyboy808
    LVL 9

    Expert Comment

    echo date("d.m.y");

    to insert  to mysql
    $mysqldate=date ("Y-m-d");
    LVL 16

    Accepted Solution

    u can do it directly from mysql
    SELECT date_format(myDate, '%d.%m.%y') as date FROM table1;

    Author Comment

    thanks dr dedo

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    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.

    754 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

    20 Experts available now in Live!

    Get 1:1 Help Now