Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Posts
    1

    Unanswered: BigInt to TimeStamp

    Hi,


    We have a metadata repository table where the timestamp field is getting stored in BIGINT.

    Below are the two such values that got created on Nov 16 2011 11:45 PM

    1321465242047
    1321465263973

    How can I retrieve the timestamp from this field.

    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Are there any documentation for the metadata repository table?

    I'm not sure, but this example gave near the created time.
    Code:
    ------------------------------ Commands Entered ------------------------------
    SELECT timestamp_col
         , TIMESTAMP('1970-01-01') + (timestamp_col * 0.001) SECONDS AS db2_timestamp
     FROM  (VALUES 1321465242047
                 , 1321465263973 ) t(timestamp_col)
    ;
    ------------------------------------------------------------------------------
    
    TIMESTAMP_COL        DB2_TIMESTAMP             
    -------------------- --------------------------
           1321465242047 2011-11-16-17.40.42.047000
           1321465263973 2011-11-16-17.41.03.973000
    
      2 record(s) selected.
    Last edited by tonkuma; 11-17-11 at 02:09. Reason: Replace whole expression to calculate db2_timestamp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •