Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Date

  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date

    What is the best way to insert a date field into a mysql database through PHP,

    ive tried DATE()

    and <?php echo date("j/n/y h:i a");?>

    however sometimes these dont work right.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think MySQL has a TIMESTAMP field type.

    http://dev.mysql.com/doc/mysql/en/DATETIME.html
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #4
    Regular Coder
    Join Date
    Mar 2004
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you want the date time at the time of inserting try now()


  •  

    Posting Permissions

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