SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question What the best way to deal with date and time??

    What the best way to deal with date and time??

    I design a small article program and I need to store date and time for article in DB.
    I need my script be accurate in calculate date and time and able to change time zone correctly.
    My question is:
    - I know there is a lot of way to do this:
    There functions in PHP to deal with date and time and there is functions in MySql to deal with date and time.
    Also we can use PHP timestamp or MySql timestamp.

    So what is the best way to do this?

    What is the best timestamp?

    In MySql im Column Types there is: numeric types and date and time types, and a lot of program use numeric types, why?


    Is there function or class to perform change between time zone.


    That's and other make big confuse to me with date and time


    That's all.

  2. #2
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,561
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use DATETIME field in the MySQL database. Later you can even retrieve value as Unix timestamp should you need it.


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
  •