Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jiggsup

    (@jiggsup)

    Sorry, that was a pretty broad request. Perhaps you could solve this by referencing a standard like MySQL timestamp, UNIX, PHP etc.

    The first thing I did with your downloaded records was a minor tweak and Inserted them into my SQL Server. If I need other engines to achieve my m/d/y goal I’m willing, just need a little direction.
    Thanks.

    Plugin Contributor helened

    (@helened)

    Converting unix timestamp to SQL datetime format is straightforward. You only need to add the timestamp value (as seconds) to the epoch date ‘1970-01-01 00:00:00’. You can do this with the “DATE_ADD” command in MySQL or “DATEADD” in SQL server:

    In SQL server:
    SELECT DATEADD(SECOND, timestamp, '1970-01-01 00:00:00') AS visit_datetime;

    Mysql requires that timestamp be converted to integer:
    SELECT DATE_ADD('1970-01-01 00:00:00', INTERVAL CAST(timestamp AS UNSIGNED) SECOND) AS visit_datetime

    Note that you probably need backticks around timestamp (not shown here)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘timestamp varchar(20)’ is closed to new replies.