Results 1 to 2 of 2

Thread: Date Format

  1. #1
    Join Date
    Dec 2015
    Posts
    3

    Unanswered: Date Format

    Hi,

    I am very new to SQL and learning as I go. I am creating some very basic php pages that gather and display data from an SQL server. I am having trouble formatting the dates though.

    I would like my date to be in the format of DD/MM/YY with no time stamps. They currently show as MM/DD/YYY HH:MMS

    My code is:

    Code:
    While ($row = mysql_fetch_array($result)) {
         exho "<b>Supplier: " .$row{'Supplier_Name'}. "
    Start Date: </b>" .$row{'Start_Date}."
    "; }

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so it looks like you are using PHP, so probably this question should be asked in the PHP forum of this site.

    but bear in mind the way a database stores information is not neccesarily the way you see that same information. this is especially true of temporal data.

    so your options are

    to change the display format in the MySQL query
    OR
    change it in the presentation layer (in your case the PHP script handling the data).
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •