How to convert timestamp to unix time?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • usbnuts
    Member
    • Sep 2001
    • 56

    How to convert timestamp to unix time?

    I have a bunch of data stored via timestamp(14) format. eg. 20010913000000.

    I was wondering how to convert all those timestamps to unix time int(10) 999556552. I want to convert the current data to vBulletin mySQL database.

    $dateposted = date("D j M Y, g:i A",$dateline);

    Thanks!
  • Kier
    Former Lead Developer, vBulletin
    • Sep 2000
    • 8179

    #2
    Code:
    SELECT yourTable.*, [color=navy][b]UNIX_TIMESTAMP([/b][/color]yourTable.[i]timeStampField[/i][color=navy][b])[/b][/color] AS unixtime FROM yourTable;
    This will return all of your table's fields, plus a special 'unixtime' field that represents the unix timestamp of the timestamp field you use.

    Last edited by Kier; Thu 13 Sep '01, 7:46pm.

    Comment

    • usbnuts
      Member
      • Sep 2001
      • 56

      #3
      Got it!

      You are good!

      Comment

      • Kier
        Former Lead Developer, vBulletin
        • Sep 2000
        • 8179

        #4

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...