SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Format DateTime

  1. #1
    SitePoint Guru
    Join Date
    Oct 2011
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Format DateTime

    Good Day!

    I had problem in displaying datetime using select statement.

    I have TimeIn and TimeOut with datatype DateTime

    I want to display it (dd-mm-yyyy) and the hours is 12 hours with AM and PM.

    now it display:

    TimeIn: 2011-10-24 05:35:00
    TimeOut: 2011-10-24 13:35:00

    this is my code:
    PHP Code:
    $sql "SELECT EMP_NO, TimeIn, TimeOut FROM attendance WHERE Date BETWEEN '$DATE1' AND '$DATE2'"
    I want to display the data
    TimeIn: 24-10-2011 05:35 AM
    TimeOut: 24-10-2011 014:35 PM

    I tried to find syntax for that but it did not match on what format i want.


    Thank you
    Thank you

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,501
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)


Bookmarks

Posting Permissions

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