SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: timestamp

  1. #1
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    timestamp

    hi...
    can someone explain me how to use mysql timestamp..
    and how to insert into timestam a value and to call that vaue out from database.
    any suggestion appreciated..
    thanx in advance!

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay...so this is a MySQL question. Am I missing something in asking why you posted in the PHP forum? Often times PHP and MySQL mix and match but the MySQL timestamp is different than the PHP one and if you're talking about MySQL, you should be putting your question out to the right forum...
    Aaron Brazell
    Technosailor



  3. #3
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx for your fulmineus help

  4. #4
    SitePoint Zealot s21825's Avatar
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP uses a UNIX timestamp format and MySQL uses a MySQL timestamp format. If you want to make the MySQL format usable by PHP you should modify your query to:

    SELECT TIMESTAMP(timestamp_column) AS unix_time FROM table WHERE something;
    s21825

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,260
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    fulminous?

    i'll move the thread

    hiya sketch

    reminder, the first timestamp column in a table is automatically maintained by mysql, you shouldn't touch it

    there's a page in the mysql docs which talks in some detail about this feature
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    fulminous?

    i'll move the thread

    hiya sketch

    reminder, the first timestamp column in a table is automatically maintained by mysql, you shouldn't touch it

    there's a page in the mysql docs which talks in some detail about this feature
    http://dev.mysql.com/doc/mysql/en/ti...p-pre-4-1.html

    First paragraph. If there is more than one timestamp then MySQL will only maintain the first one.

    Also, you can pull out the TIMESTAMP as is from MySQL and use PHP to do the conversion (if you want).

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    fulminous?

    i'll move the thread

    hiya sketch

    reminder, the first timestamp column in a table is automatically maintained by mysql, you shouldn't touch it

    there's a page in the mysql docs which talks in some detail about this feature
    some e missmatched there... maybe couse of fast typing

    thanx for your help guys....
    cheers


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
  •