php timestamp and mysql timestamp not matching?

Discussion in 'PHP' started by Imozeb, Jun 7, 2010.

  1. #1
    Why would my php timestamp and mysql timestamp not match?

    Mysql's timestamp is set to 'on update' = 'current_time' which is converted with string_to_time() in php to a timestamp.

    PHP is using the time(); command to get the current timestamp.

    The values don't match? There off by about 60000 digits? Why is this?
     
    Imozeb, Jun 7, 2010 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    digitalpoint, Jun 7, 2010 IP
  3. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I did set the timezone in my php.ini file and ran a query in mysql to set the timezone of the server. It still didn't work so I found a work around. I just populated the timestamp field manually through php instead of using mysql's update timestamp function. Therefore the timestamps are in the same timezone, php's.
     
    Imozeb, Jun 8, 2010 IP