SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Enter Dates Before 1970

    How do i display dates in PHP which are before the year 1970 ?
    in mysql it shows the data properly as say 1965-10-01 00:00:00
    but when i try to display it in PHP it fails

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    use mysql DATETIME datatype
    The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah sorry r937, i was just editing my comment...actaully the date is being stored properly in mysql but the problem is when i use the date() in PHP to display it.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got the solution use the date_format function of mysql to format your date instead of the date() of PHP


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
  •